diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-01-19 20:02:40 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-01-19 20:15:13 +0100 |
commit | a6105c8ea0bdae9d56d1943409d89cc71288306a (patch) | |
tree | e94ae56326809035e38d3f7bb6cdfb747e692d5c /modules/mono | |
parent | d11d7dfe3e15e34ba400e6b73d618abc4b8f5886 (diff) |
Fix ClassDB API portability with some android and editor classes
- `EditorNavigationMeshGenerator` was being registered as part of the Core API,
even after d3f48f88bb84d22b7805ce971ac86cf1953a29fd. We must make sure to
set Editor as the current ClassDB API type before creating an instance.
- The `VisualScriptEngineSingleton.constant` property has a property hint string
that's different between tools and non-tools builds. This commit makes the
hint string to no longer be set in `_bind_methods`, and to instead set it in
`_validate_property`. This way it's ignored when calculating the API hash.
- `JavaClassWrapper` is now registered in ClassDB on all platforms,
using a dummy implementation on platforms other than Android.
This fixes API portability between Android and other platforms.
- Updated `--class-db-json` command to ignore non-virtual methods that start
with an underscore (see: 4be87c6016a5893cbde897924e540df4c988cee5).
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/class_db_api_json.cpp | 7 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/modules/mono/class_db_api_json.cpp b/modules/mono/class_db_api_json.cpp index c1d6f4dccf..b04e53bd81 100644 --- a/modules/mono/class_db_api_json.cpp +++ b/modules/mono/class_db_api_json.cpp @@ -71,6 +71,13 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) { while ((k = t->method_map.next(k))) { + String name = k->operator String(); + + ERR_CONTINUE(name.empty()); + + if (name[0] == '_') + continue; // Ignore non-virtual methods that start with an underscore + snames.push_back(*k); } diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 0f6b8357b8..210267e681 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -106,7 +106,7 @@ Error CSharpLanguage::execute_file(const String &p_path) { void CSharpLanguage::init() { #ifdef DEBUG_METHODS_ENABLED - if (OS::get_singleton()->get_cmdline_args().find("--class_db_to_json")) { + if (OS::get_singleton()->get_cmdline_args().find("--class-db-json")) { class_db_api_to_json("user://class_db_api.json", ClassDB::API_CORE); #ifdef TOOLS_ENABLED class_db_api_to_json("user://class_db_api_editor.json", ClassDB::API_EDITOR); |