diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml index 58a2bd72..038c8d4f 100644 --- a/.github/workflows/build_android.yml +++ b/.github/workflows/build_android.yml @@ -12,14 +12,6 @@ on: # Global Settings env: - # 4.4 - SCONSFLAGS: >- - arch=arm64 - strict_checks=yes - debug_symbols=no - module_text_server_fb_enabled=yes - swappy=yes - # 4.5+ # Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options. SCONS_FLAGS: >- arch=arm64 @@ -91,22 +83,7 @@ jobs: - name: Extract pre-built Android Swappy Frame Pacing Library run: 7za x -y swappy/godot-swappy.7z -o${{github.workspace}}/thirdparty/swappy-frame-pacing - - name: Compilation [4.4] - if: inputs.version == '4.4' - uses: ./.github/actions/godot-build - with: - sconsflags: >- - ${{ env.SCONSFLAGS }} - ${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }} - deprecated=no - ndk_platform=android-24 - generate_apk=yes - platform: android - target: ${{ matrix.target }} - scons-cache-limit: 1 - - - name: Compilation [4.5+] - if: inputs.version != '4.4' + - name: Compilation uses: ./.github/actions/godot-build with: scons-flags: >- diff --git a/.github/workflows/build_ios.yml b/.github/workflows/build_ios.yml index 5ac2c5b4..d55deb49 100644 --- a/.github/workflows/build_ios.yml +++ b/.github/workflows/build_ios.yml @@ -12,11 +12,6 @@ on: # Global Settings env: - # 4.4 - SCONSFLAGS: >- - debug_symbols=no - module_text_server_fb_enabled=yes - # 4.5+ # Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options. SCONS_FLAGS: >- verbose=yes @@ -69,19 +64,7 @@ jobs: - name: Setup Python and SCons uses: ./.github/actions/godot-deps - - name: Compilation [4.4] - if: inputs.version == '4.4' - uses: ./.github/actions/godot-build - with: - sconsflags: >- - ${{ env.SCONSFLAGS }} - ${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }} - platform: ios - target: ${{ matrix.target }} - scons-cache-limit: 1 - - - name: Compilation [4.5+] - if: inputs.version != '4.4' + - name: Compilation uses: ./.github/actions/godot-build with: scons-flags: >- diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index f33fab58..f60b3469 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -15,11 +15,6 @@ on: # Global Settings env: - # 4.4 - SCONSFLAGS: >- - module_text_server_fb_enabled=yes - strict_checks=yes - # 4.5 # Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options. SCONS_FLAGS: >- verbose=yes @@ -94,8 +89,7 @@ jobs: - name: Setup Python and SCons uses: ./.github/actions/godot-deps - - name: Download pre-built AccessKit [4.5+] - if: inputs.version != '4.4' + - name: Download pre-built AccessKit uses: dsaltares/fetch-gh-release-asset@1.1.2 with: repo: AccessKit/accesskit-c @@ -103,25 +97,10 @@ jobs: file: accesskit-c-0.17.0.zip target: accesskit-c-0.17.0/accesskit_c.zip - - name: Extract pre-built AccessKit [4.5+] - if: inputs.version != '4.4' + - name: Extract pre-built AccessKit run: unzip -o accesskit-c-0.17.0/accesskit_c.zip - - name: Compilation [4.4] - if: inputs.version == '4.4' - uses: ./.github/actions/godot-build - with: - sconsflags: >- - ${{ env.SCONSFLAGS }} - ${{ matrix.target != 'editor' && 'debug_symbols=no' || '' }} - ${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }} - ${{ inputs.tests && matrix.target == 'editor' && 'tests=yes' || '' }} - platform: linuxbsd - target: ${{ matrix.target }} - scons-cache-limit: ${{ matrix.target == 'editor' && 2 || 1 }} - - - name: Compilation [4.5+] - if: inputs.version != '4.4' + - name: Compilation uses: ./.github/actions/godot-build with: scons-flags: >- diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index 7c468261..385bece8 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -15,11 +15,6 @@ on: # Global Settings env: - # 4.4 - SCONSFLAGS: >- - module_text_server_fb_enabled=yes - strict_checks=yes - # 4.5 # Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options. SCONS_FLAGS: >- verbose=yes @@ -68,8 +63,7 @@ jobs: - name: Setup Python and SCons uses: ./.github/actions/godot-deps - - name: Download pre-built AccessKit [4.5+] - if: inputs.version != '4.4' + - name: Download pre-built AccessKit uses: dsaltares/fetch-gh-release-asset@1.1.2 with: repo: AccessKit/accesskit-c @@ -77,8 +71,7 @@ jobs: file: accesskit-c-0.17.0.zip target: accesskit-c-0.17.0/accesskit_c.zip - - name: Extract pre-built AccessKit [4.5+] - if: inputs.version != '4.4' + - name: Extract pre-built AccessKit run: unzip -o accesskit-c-0.17.0/accesskit_c.zip - name: Setup Vulkan SDK @@ -105,23 +98,7 @@ jobs: name: tests-project path: ${{github.workspace}}/modules/GodotJS/tests/project/.godot/GodotJS - - name: Compilation [4.4] (x86_64) - if: inputs.version == '4.4' - uses: ./.github/actions/godot-build - with: - sconsflags: >- - ${{ env.SCONSFLAGS }} - ${{ matrix.target != 'editor' && 'debug_symbols=no' || '' }} - ${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }} - arch=x86_64 - vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }} - ${{ inputs.tests && matrix.target == 'editor' && 'tests=yes' || '' }} - platform: macos - target: ${{ matrix.target }} - scons-cache-limit: 0 # Only cap on second run to avoid purging unnecessarily - - - name: Compilation [4.5+] (x86_64) - if: inputs.version != '4.4' + - name: Compilation (x86_64) uses: ./.github/actions/godot-build with: scons-flags: >- @@ -134,23 +111,7 @@ jobs: platform: macos target: ${{ matrix.target }} - - name: Compilation [4.4] (arm64) - if: inputs.version == '4.4' - uses: ./.github/actions/godot-build - with: - sconsflags: >- - ${{ env.SCONS_FLAGS }} - ${{ matrix.target != 'editor' && 'debug_symbols=no' || '' }} - ${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }} - arch=arm64 - vulkan=${{ steps.vulkan-sdk.outputs.VULKAN_ENABLED }} - ${{ inputs.tests && matrix.target == 'editor' && 'tests=yes' || '' }} - platform: macos - target: ${{ matrix.target }} - scons-cache-limit: ${{ matrix.target == 'editor' && 2 || 1 }} - - - name: Compilation [4.5+] (arm64) - if: inputs.version != '4.4' + - name: Compilation (arm64) uses: ./.github/actions/godot-build with: scons-flags: >- diff --git a/.github/workflows/build_web.yml b/.github/workflows/build_web.yml index 41b0bef1..ed862dfd 100644 --- a/.github/workflows/build_web.yml +++ b/.github/workflows/build_web.yml @@ -12,16 +12,6 @@ on: # Global Settings env: - # 4.4 - SCONSFLAGS: >- - debug_symbols=no - use_closure_compiler=yes - strict_checks=yes - deprecated=no - lto=none - use_assertions=no - use_safe_heap=yes - # 4.5+ # Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options. SCONS_FLAGS: >- verbose=yes @@ -78,11 +68,7 @@ jobs: env: GODOT_VERSION: ${{ inputs.version }} run: | - if [[ $GODOT_VERSION == "4.4" ]]; then - echo "emscripten=3.1.64" >> $GITHUB_OUTPUT - else - echo "emscripten=4.0.11" >> $GITHUB_OUTPUT - fi + echo "emscripten=4.0.11" >> $GITHUB_OUTPUT - name: Set up Emscripten uses: mymindstorm/setup-emsdk@v14 @@ -103,19 +89,7 @@ jobs: - name: Setup Python and SCons uses: ./.github/actions/godot-deps - - name: Compilation [4.4] - if: inputs.version == '4.4' - uses: ./.github/actions/godot-build - with: - sconsflags: >- - ${{ env.SCONSFLAGS }} - ${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }} - platform: web - target: ${{ matrix.target }} - scons-cache-limit: 0.5 - - - name: Compilation [4.5+] - if: inputs.version != '4.4' + - name: Compilation uses: ./.github/actions/godot-build with: scons-flags: >- diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 4e27f718..684ff08a 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -16,14 +16,6 @@ on: # Global Settings # SCONS_CACHE for windows must be set in the build environment env: - # 4.4 - SCONSFLAGS: >- - module_text_server_fb_enabled=yes - d3d12=yes - strict_checks=yes - debug_symbols=no - "angle_libs=${{ github.workspace }}/" - # 4.5+ # Ideally we'd use dev_mode=yes. Unfortunately, v8 headers contain warnings. So we manually set some dev_mode options. SCONS_FLAGS: >- verbose=yes @@ -101,8 +93,7 @@ jobs: - name: Extract pre-built ANGLE static libraries run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/ - - name: Download pre-built AccessKit [4.5+] - if: inputs.version != '4.4' + - name: Download pre-built AccessKit uses: dsaltares/fetch-gh-release-asset@1.1.2 with: repo: AccessKit/accesskit-c @@ -110,25 +101,10 @@ jobs: file: accesskit-c-0.17.0.zip target: accesskit-c-0.17.0/accesskit_c.zip - - name: Extract pre-built AccessKit [4.5+] - if: inputs.version != '4.4' + - name: Extract pre-built AccessKit run: unzip -o accesskit-c-0.17.0/accesskit_c.zip - - name: Compilation (4.4) - if: inputs.version == '4.4' - uses: ./.github/actions/godot-build - with: - sconsflags: >- - ${{ env.SCONSFLAGS }} - ${{ matrix.target == 'editor' && 'vsproj=yes vsproj_gen_only=no windows_subsystem=console' || '' }} - ${{ matrix.engine == 'qjs-ng' && 'use_quickjs_ng=yes' || '' }} - ${{ inputs.tests && matrix.target == 'editor' && 'tests=yes' || '' }} - platform: windows - target: ${{ matrix.target }} - scons-cache-limit: 2 - - - name: Compilation (4.5+) - if: inputs.version != '4.4' + - name: Compilation uses: ./.github/actions/godot-build with: scons-flags: >- diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index 6c7ca37e..3fdce17b 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -34,10 +34,10 @@ jobs: fail-fast: false matrix: include: - - version: 4.4 - version_ref: 4.4 - version: 4.5 version_ref: 4.5 + - version: 4.6dev + version_ref: master uses: ./.github/workflows/build_engine_version.yml with: version: ${{ matrix.version }} diff --git a/bridge/jsb_editor_utility_funcs.cpp b/bridge/jsb_editor_utility_funcs.cpp index 6611a1ac..7e3038de 100644 --- a/bridge/jsb_editor_utility_funcs.cpp +++ b/bridge/jsb_editor_utility_funcs.cpp @@ -1,6 +1,12 @@ #include "jsb_editor_utility_funcs.h" #include "jsb_type_convert.h" +#if GODOT_4_6_OR_NEWER +using ConstantHashMap = AHashMap; +#else +using ConstantHashMap = HashMap; +#endif + #if JSB_WITH_EDITOR_UTILITY_FUNCS namespace jsb_private { @@ -318,7 +324,7 @@ namespace jsb set_field(isolate, context, object, JSB_GET_FIELD_NAME_PRESET(enum_info, is_bitfield)); } - void build_enum_info(v8::Isolate* isolate, const v8::Local& context, const HashMap& constants, const StringName &enum_name, const ClassDB::ClassInfo::EnumInfo& enum_info, const v8::Local& object) + void build_enum_info(v8::Isolate* isolate, const v8::Local& context, const ConstantHashMap& constants, const StringName &enum_name, const ClassDB::ClassInfo::EnumInfo& enum_info, const v8::Local& object) { v8::Local values_object = v8::Object::New(isolate); int index = 0; @@ -438,7 +444,7 @@ namespace jsb v8::Local enums_obj = v8::Array::New(isolate, (int) class_info.enum_map.size()); set_field(isolate, context, class_info_obj, "enums", enums_obj); int index = 0; - HashMap constants = class_info.constant_map; + const ConstantHashMap& constants = class_info.constant_map; for (const KeyValue& pair : class_info.enum_map) { JSB_HANDLE_SCOPE(isolate); diff --git a/compat/jsb_engine_version_comparison.h b/compat/jsb_engine_version_comparison.h index 84370972..b4402b8c 100644 --- a/compat/jsb_engine_version_comparison.h +++ b/compat/jsb_engine_version_comparison.h @@ -18,5 +18,6 @@ #define GODOT_4_3_OR_NEWER GODOT_VERSION_NEWER_THAN(4, 3, -1) #define GODOT_4_4_OR_NEWER GODOT_VERSION_NEWER_THAN(4, 4, -1) #define GODOT_4_5_OR_NEWER GODOT_VERSION_NEWER_THAN(4, 5, -1) +#define GODOT_4_6_OR_NEWER GODOT_VERSION_NEWER_THAN(4, 6, -1) #endif diff --git a/internal/jsb_naming_util.cpp b/internal/jsb_naming_util.cpp index 32b98f1c..f71a57bd 100644 --- a/internal/jsb_naming_util.cpp +++ b/internal/jsb_naming_util.cpp @@ -376,8 +376,13 @@ namespace jsb::internal } #endif +#if GODOT_4_6_OR_NEWER + LocalVector all_class_names; + ClassDB::get_class_list(all_class_names); +#else List all_class_names; ClassDB::get_class_list(&all_class_names); +#endif List exposed_class_names; diff --git a/weaver/jsb_script_instance.h b/weaver/jsb_script_instance.h index d603d94d..93084667 100644 --- a/weaver/jsb_script_instance.h +++ b/weaver/jsb_script_instance.h @@ -126,7 +126,11 @@ class GodotJSScriptInstance : public GodotJSScriptInstanceBase // object handle (the JS object binding id) jsb::NativeObjectID object_id_; +#ifdef GODOT_4_6_OR_NEWER + HashMap property_cache_; +#else HashMap property_cache_; +#endif private: jsb::ScriptClassInfoPtr get_script_class() const; diff --git a/weaver/jsb_script_language.h b/weaver/jsb_script_language.h index 0822917f..6601209d 100644 --- a/weaver/jsb_script_language.h +++ b/weaver/jsb_script_language.h @@ -198,9 +198,11 @@ class GodotJSScriptLanguage : public ScriptLanguage #endif virtual bool is_using_templates() override { return true; } +#if !GODOT_4_6_OR_NEWER #ifndef DISABLE_DEPRECATED virtual bool has_named_classes() const override { return false; } #endif // DISABLE_DEPRECATED +#endif // !GODOT_4_6_OR_NEWER virtual bool supports_builtin_mode() const override { return false; } virtual int find_function(const String& p_function, const String& p_code) const override { return -1; }