diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-05-20 18:34:35 +0200 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2019-06-03 17:09:24 +0200 |
commit | 14df9e5cb2e9f2de4adf9b979e8ef33de37b80bd (patch) | |
tree | 1f896d45a14d5a7c777d45b02ad7ca780cc30cd7 /modules/mono/editor | |
parent | 22583ec6a39bb56943c78c0ed9a094b28b666b75 (diff) |
Android build and export for the mono module
Diffstat (limited to 'modules/mono/editor')
-rw-r--r-- | modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs | 3 | ||||
-rw-r--r-- | modules/mono/editor/godotsharp_export.cpp | 22 |
2 files changed, 19 insertions, 6 deletions
diff --git a/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs b/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs index e45dd2025b..44a43f0ddd 100644 --- a/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs +++ b/modules/mono/editor/GodotSharpTools/Editor/GodotSharpExport.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Runtime.CompilerServices; namespace GodotSharpTools.Editor @@ -62,7 +63,7 @@ namespace GodotSharpTools.Editor { // OSX export templates are contained in a zip, so we place // our custom template inside it and let Godot do the rest. - return !featureSet.Contains("OSX"); + return !featureSet.Any(f => new[] {"OSX", "Android"}.Contains(f)); } [MethodImpl(MethodImplOptions.InternalCall)] diff --git a/modules/mono/editor/godotsharp_export.cpp b/modules/mono/editor/godotsharp_export.cpp index ae5b939b26..126178125f 100644 --- a/modules/mono/editor/godotsharp_export.cpp +++ b/modules/mono/editor/godotsharp_export.cpp @@ -125,11 +125,21 @@ void GodotSharpExport::_export_begin(const Set<String> &p_features, bool p_debug bool load_success = GDMono::get_singleton()->load_assembly_from(project_dll_name, project_dll_src_path, &scripts_assembly, /* refonly: */ true); - ERR_EXPLAIN("Cannot load refonly assembly: " + project_dll_name); + ERR_EXPLAIN("Cannot load assembly (refonly): " + project_dll_name); ERR_FAIL_COND(!load_success); Vector<String> search_dirs; - GDMonoAssembly::fill_search_dirs(search_dirs, build_config); + String templates_dir = EditorSettings::get_singleton()->get_templates_dir().plus_file(VERSION_FULL_CONFIG); + String android_bcl_dir = templates_dir.plus_file("android-bcl"); + + String custom_lib_dir; + + if (p_features.find("Android") && DirAccess::exists(android_bcl_dir)) { + custom_lib_dir = android_bcl_dir; + } + + GDMonoAssembly::fill_search_dirs(search_dirs, build_config, custom_lib_dir); + Error depend_error = _get_assembly_dependencies(scripts_assembly, search_dirs, dependencies); ERR_FAIL_COND(depend_error != OK); } @@ -152,7 +162,7 @@ void GodotSharpExport::_export_begin(const Set<String> &p_features, bool p_debug int i = 0; for (const Set<String>::Element *E = p_features.front(); E; E = E->next()) { MonoString *boxed = GDMonoMarshal::mono_string_from_godot(E->get()); - mono_array_set(features, MonoString *, i, boxed); + mono_array_setref(features, i, boxed); i++; } @@ -234,8 +244,10 @@ Error GodotSharpExport::_get_assembly_dependencies(GDMonoAssembly *p_assembly, c r_dependencies.insert(ref_name, ref_assembly->get_path()); Error err = _get_assembly_dependencies(ref_assembly, p_search_dirs, r_dependencies); - if (err != OK) - return err; + if (err != OK) { + ERR_EXPLAIN("Cannot load one of the dependencies for the assembly: " + ref_name); + ERR_FAIL_V(err); + } } return OK; |