From f7d2b1430f846fa3fd1805fc418500653d9040f4 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Thu, 14 Mar 2024 08:15:40 +0100 Subject: [PATCH 01/17] improve macosx version --- samples/sampler.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/samples/sampler.rb b/samples/sampler.rb index 6c1e4de2..dbf3f975 100644 --- a/samples/sampler.rb +++ b/samples/sampler.rb @@ -168,13 +168,15 @@ def initialize(title) @sample_editor = nil menu_bar = Wx::MenuBar.new - # The "file" menu - menu_file = Wx::Menu.new - # Using Wx::ID_EXIT standard id means the menu item will be given - # the right label for the platform and language, and placed in the - # correct platform-specific menu - eg on OS X, in the Application's menu - menu_file.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit wxRuby Sampler") - menu_bar.append(menu_file, "&File") + unless Wx::PLATFORM == 'WXOSX' + # The "file" menu + menu_file = Wx::Menu.new + # Don't add a File menu with only Exit item on OSX as on OSX + # the Exit item there will be hidden and a standard one added to + # the Apple Application menu leaving an empty File menu + menu_file.append(Wx::ID_EXIT, "E&xit\tAlt-X", "Quit wxRuby Sampler") + menu_bar.append(menu_file, "&File") + end # The "help" menu menu_help = Wx::Menu.new From b0a6a7c03455f400c33bf58db16162bc71542380 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Thu, 14 Mar 2024 08:31:18 +0100 Subject: [PATCH 02/17] update doc --- lib/wx/doc/app.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wx/doc/app.rb b/lib/wx/doc/app.rb index 61d28a0f..8e5e92fb 100644 --- a/lib/wx/doc/app.rb +++ b/lib/wx/doc/app.rb @@ -12,7 +12,7 @@ class App class << self # Set the menu item id for the About menu item. - # Default is {Wx::ID_ABOUT} + # Default is {Wx::ID_ABOUT}. Setting to {Wx::ID_NONE} will disable moving the About item to the Application menu. # @param [Integer] id # @wxrb_require WXOSX def set_mac_about_menu_itemid(id) end @@ -40,7 +40,7 @@ def get_mac_preferences_menu_itemid; end alias :mac_preferences_menu_itemid :get_mac_preferences_menu_itemid # Set the menu item id for the Exit menu item. - # Default is {Wx::ID_EXIT} + # Default is {Wx::ID_EXIT}. Setting to {Wx::ID_NONE} will disable hiding the exit item. Standard item will still be added to Application menu. # @param [Integer] id # @wxrb_require WXOSX def set_mac_exit_menu_itemid(id) end From 2d3c45b5fdc0bb4a634a2858dd960c46da655cee Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Thu, 14 Mar 2024 08:42:21 +0100 Subject: [PATCH 03/17] update doc --- lib/wx/doc/app.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/wx/doc/app.rb b/lib/wx/doc/app.rb index 8e5e92fb..4e9c804b 100644 --- a/lib/wx/doc/app.rb +++ b/lib/wx/doc/app.rb @@ -15,6 +15,7 @@ class << self # Default is {Wx::ID_ABOUT}. Setting to {Wx::ID_NONE} will disable moving the About item to the Application menu. # @param [Integer] id # @wxrb_require WXOSX + # @see Wx::App.get_mac_about_menu_itemid def set_mac_about_menu_itemid(id) end alias :mac_about_menu_itemid= :set_mac_about_menu_itemid @@ -22,6 +23,7 @@ def set_mac_about_menu_itemid(id) end # Default is {Wx::ID_ABOUT} # @return [Integer] # @wxrb_require WXOSX + # @see Wx::App.set_mac_about_menu_itemid def get_mac_about_menu_itemid; end alias :mac_about_menu_itemid :get_mac_about_menu_itemid @@ -29,6 +31,7 @@ def get_mac_about_menu_itemid; end # Default is {Wx::ID_PREFERENCES} # @param [Integer] id # @wxrb_require WXOSX + # @see Wx::App.get_mac_preferences_menu_itemid def set_mac_preferences_menu_itemid(id) end alias :mac_preferences_menu_itemid= :set_mac_preferences_menu_itemid @@ -36,6 +39,7 @@ def set_mac_preferences_menu_itemid(id) end # Default is {Wx::ID_PREFERENCES} # @return [Integer] # @wxrb_require WXOSX + # @see Wx::App.set_mac_preferences_menu_itemid def get_mac_preferences_menu_itemid; end alias :mac_preferences_menu_itemid :get_mac_preferences_menu_itemid @@ -43,6 +47,7 @@ def get_mac_preferences_menu_itemid; end # Default is {Wx::ID_EXIT}. Setting to {Wx::ID_NONE} will disable hiding the exit item. Standard item will still be added to Application menu. # @param [Integer] id # @wxrb_require WXOSX + # @see Wx::App.get_mac_exit_menu_itemid def set_mac_exit_menu_itemid(id) end alias :mac_exit_menu_itemid= :set_mac_exit_menu_itemid @@ -50,6 +55,7 @@ def set_mac_exit_menu_itemid(id) end # Default is {Wx::ID_EXIT} # @return [Integer] # @wxrb_require WXOSX + # @see Wx::App.set_mac_exit_menu_itemid def get_mac_exit_menu_itemid; end alias :mac_exit_menu_itemid :get_mac_exit_menu_itemid @@ -57,6 +63,7 @@ def get_mac_exit_menu_itemid; end # Default is '&Help' # @param [String] title # @wxrb_require WXOSX + # @see Wx::App.get_mac_help_menu_title def set_mac_help_menu_title(title) end alias :mac_help_menu_title= :set_mac_help_menu_title @@ -64,6 +71,7 @@ def set_mac_help_menu_title(title) end # Default is '&Help' # @return [String] # @wxrb_require WXOSX + # @see Wx::App.set_mac_help_menu_title def get_mac_help_menu_title; end alias :mac_help_menu_title :get_mac_help_menu_title @@ -71,6 +79,7 @@ def get_mac_help_menu_title; end # Default is '&Window' # @param [String] title # @wxrb_require WXOSX + # @see Wx::App.get_mac_window_menu_title def set_mac_window_menu_title(title) end alias :mac_window_menu_title= :set_mac_window_menu_title @@ -78,6 +87,7 @@ def set_mac_window_menu_title(title) end # Default is '&Window' # @return [String] # @wxrb_require WXOSX + # @see Wx::App.set_mac_window_menu_title def get_mac_window_menu_title; end alias :mac_window_menu_title :get_mac_window_menu_title From 4267687872b0ce45be3dbbada820d873779c57f5 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Fri, 15 Mar 2024 18:54:37 +0100 Subject: [PATCH 04/17] add AppDisplayName workaround for Apple menu --- lib/wx/core/menu_bar.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/wx/core/menu_bar.rb b/lib/wx/core/menu_bar.rb index 699f03fb..053f4fc6 100644 --- a/lib/wx/core/menu_bar.rb +++ b/lib/wx/core/menu_bar.rb @@ -12,6 +12,17 @@ class Wx::MenuBar def initialize(*args, &block) wx_initialize(*args) + if Wx::PLATFORM == 'WXOSX' + # OSX's standard Apple/Application menu gets titled with the executables name by default + # which is 'ruby' for wxRuby and this title is near impossible to reliably change. + # Therefor we implemented (a little stunted) workaround here to deal with Apple's crap. + # We insert a disabled item at the start of this menu with the AppDisplayName and follow + # it up with a nice separator. This way at least we will always be able to see which wxRuby + # app the visible menu belongs to. + apple_menu = osx_get_apple_menu + apple_menu.insert(0, Wx::ID_NONE, Wx.get_app.get_app_display_name).enable(false) + apple_menu.insert_separator(1) + end if block if block.arity == -1 or block.arity == 0 self.instance_eval(&block) From 87c226c951dd0dace28ffc4a35ed6ac624c5001e Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sat, 16 Mar 2024 11:53:59 +0100 Subject: [PATCH 05/17] only hide when iconized --- samples/sampler.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/sampler.rb b/samples/sampler.rb index dbf3f975..9bbad5c6 100644 --- a/samples/sampler.rb +++ b/samples/sampler.rb @@ -359,9 +359,9 @@ def on_close(_evt) destroy end - def on_iconize(_evt) - hide - _evt.skip + def on_iconize(evt) + hide if evt.iconized? + evt.skip end # End the application; it should finish automatically when the last From 6b83451b410247e7b77fcc36738f8d44c366338a Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sat, 16 Mar 2024 12:02:29 +0100 Subject: [PATCH 06/17] fix iconizing sampler app --- samples/sampler.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/sampler.rb b/samples/sampler.rb index 9bbad5c6..a28ead0a 100644 --- a/samples/sampler.rb +++ b/samples/sampler.rb @@ -360,7 +360,9 @@ def on_close(_evt) end def on_iconize(evt) - hide if evt.iconized? + # hide is required to hide the application icon from the taskbar on Windows and Linux GTK + # but brings no benefits and causes problems on MacOSX so don't hide there + hide if evt.iconized? && Wx::PLATFORM != 'WXOSX' evt.skip end From 0313ab42a35541b46d91dc9a1f3ded3002eac69a Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sat, 16 Mar 2024 14:26:48 +0100 Subject: [PATCH 07/17] remove incorrect version dependency --- rakelib/lib/director/menu_bar.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/rakelib/lib/director/menu_bar.rb b/rakelib/lib/director/menu_bar.rb index 1e59e255..849836a2 100644 --- a/rakelib/lib/director/menu_bar.rb +++ b/rakelib/lib/director/menu_bar.rb @@ -23,9 +23,6 @@ def setup 'wxMenuBar::GetLabelTop', 'wxMenuBar::SetLabelTop', 'wxMenuBar::Refresh') - unless Config.instance.wx_version >= '3.3' || Config.instance.wx_abi_version > '3.0.0' - spec.ignore 'wxMenuBar::OSXGetAppleMenu' - end # for FindItem spec.map 'wxMenu **' => 'Wx::Menu' do map_in ignore: true, temp: 'wxMenu *tmp', code: '$1 = &tmp;' From 110085367d40fdadc029af29d499b662e5af93f0 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sat, 16 Mar 2024 15:42:33 +0100 Subject: [PATCH 08/17] fix embedded wxWidgets release selection --- rakelib/lib/config/unixish.rb | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/rakelib/lib/config/unixish.rb b/rakelib/lib/config/unixish.rb index 6590d626..f9ba5bcf 100644 --- a/rakelib/lib/config/unixish.rb +++ b/rakelib/lib/config/unixish.rb @@ -86,28 +86,18 @@ def download_file(url, dest) private - def wx_gitref - super || - expand("#{get_cfg_string('git')} tag").split("\n").select do |t| - (/\Av(\d+)\.(\d+)\.\d+\Z/ =~ t) && (($1.to_i == 3 && $2.to_i >= 2) || $1.to_i > 3) - end.max - end - def wx_checkout $stdout.print 'Checking out wxWidgets...' if run_silent? # clone wxWidgets GIT repository under ext_path chdir(ext_path) do if (rc = sh("#{get_cfg_string('git')} clone https://github.com/wxWidgets/wxWidgets.git")) chdir('wxWidgets') do - tag = if @wx_version - "v#{@wx_version}" - else - expand("#{get_cfg_string('git')} tag").split("\n").select do |t| - (/\Av(\d+)\.(\d+)\.\d+\Z/ =~ t) && (($1.to_i==3 && $2.to_i >= 2) || $1.to_i>3) - end.max - end + tag = wx_gitref || + expand("#{get_cfg_string('git')} tag").split("\n").select do |t| + (/\Av(\d+)\.(\d+)\.\d+\Z/ =~ t) && (($1.to_i == 3 && $2.to_i >= 2) || $1.to_i > 3) + end.max # checkout the version we are building against - rc = sh("#{get_cfg_string('git')} checkout #{wx_gitref}") + rc = sh("#{get_cfg_string('git')} checkout #{tag}") end end if rc From 16d15ae806146b9dc29a09efea4c01f7a9b522a7 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sat, 16 Mar 2024 16:25:16 +0100 Subject: [PATCH 09/17] fix execute --- rakelib/lib/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rakelib/lib/config.rb b/rakelib/lib/config.rb index 0716aaaf..3d778ea2 100644 --- a/rakelib/lib/config.rb +++ b/rakelib/lib/config.rb @@ -313,7 +313,7 @@ def make_ruby_cmd(*cmd, verbose: true) private :make_ruby_cmd def execute(*cmd) - do_run(*cmd.flatten) + sh(exec_env.merge({'RUBYLIB'=>rb_lib_path}), cmd.flatten.join(' '), fail_on_error: true) end def run(*cmd, capture: nil, verbose: true) From 431e47c4f71fa092a76db56fc43c694e20a3f4d3 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sat, 16 Mar 2024 16:30:43 +0100 Subject: [PATCH 10/17] add wxwidgets version checks --- .github/workflows/linux.yml | 12 +++++++++++- .github/workflows/mac.yml | 10 ++++++++++ .github/workflows/msw.yml | 12 +++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6458d0f4..e921b388 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -42,6 +42,7 @@ permissions: env: WXWIDGETS_ROOT: ${{ github.workspace }}/ext/wxWidgets WXWIN_INSTALL: ${{ github.workspace }}/ext/wxWidgets/install + WXWIDGETS_LATEST_STABLE: 3.2.4 jobs: build: @@ -284,7 +285,16 @@ jobs: if [ "${{ matrix.wxw_type }}" == "develop" ]; then export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WXWIN_INSTALL/lib fi - wxruby check + wxruby check + + - name: Check embedded wxWidgets version + if: matrix.wxw_type == 'embed' + run: | + if [ "${{ matrix.wxr_type }}" == "develop" ]; then + bundle exec rake wxruby:exec[ruby,-r,wx,-e,"\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'\""] + else + ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'" + fi - name: Run wxRuby3 regression tests run: | diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 021d7e14..a7d148b9 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -113,6 +113,7 @@ jobs: NSUnbufferedIO: YES WXWIDGETS_ROOT: ${{ github.workspace }}/ext/wxWidgets WXWIN_INSTALL: ${{ github.workspace }}/ext/wxWidgets/install + WXWIDGETS_LATEST_STABLE: 3.2.4 steps: - name: Show default Ruby @@ -328,6 +329,15 @@ jobs: run: | wxruby check + - name: Check embedded wxWidgets version + if: matrix.wxw_type == 'embed' + run: | + if [ "${{ matrix.wxr_type }}" == "develop" ]; then + bundle exec rake wxruby:exec[ruby,-r,wx,-e,"\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'\""] + else + ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'" + fi + - name: Run wxRuby3 regression tests run: | if [ "${{ matrix.wxr_type }}" == "develop" ]; then diff --git a/.github/workflows/msw.yml b/.github/workflows/msw.yml index 412fd34f..36cb89bd 100644 --- a/.github/workflows/msw.yml +++ b/.github/workflows/msw.yml @@ -44,7 +44,7 @@ env: DOXYGEN_ROOT: ${{ github.workspace }}\doxygen WXWIDGETS_ROOT: ${{ github.workspace }}\ext\wxWidgets WXWIN_ROOT: ${{ github.workspace }}\ext\wxWidgets\install -# WXRUBY_RELEASE: 1 + WXWIDGETS_LATEST_STABLE: 3.2.4 jobs: build: @@ -216,6 +216,16 @@ jobs: run: | wxruby check + - name: Check embedded wxWidgets version + if: matrix.wxw_type == 'embed' + run: | + If ("${{ matrix.wxr_type }}" -eq "develop") { + bundle exec rake wxruby:exec[ruby,-r,wx,-e,"\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'\""] + } + Else { + ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'" + } + - name: Run wxRuby3 regression tests run: | If ("${{ matrix.wxr_type }}" -eq "develop") { From 481875cbaead84f41172fa5775f0f00b06384299 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sat, 16 Mar 2024 17:31:04 +0100 Subject: [PATCH 11/17] increase minimum ABI version --- rakelib/lib/config/unixish.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rakelib/lib/config/unixish.rb b/rakelib/lib/config/unixish.rb index f9ba5bcf..7ec2254a 100644 --- a/rakelib/lib/config/unixish.rb +++ b/rakelib/lib/config/unixish.rb @@ -219,8 +219,8 @@ def init_unix_platform # add ruby defined shared ruby lib(s); not any other flags @ruby_libs.concat RB_CONFIG['LIBRUBYARG_SHARED'].split(' ').select { |s| s.start_with?('-l')} - # maintain minimum compatibility with ABI 3.0.0 - @wx_abi_version = [ @wx_version, "3.0.0" ].min + # maintain minimum compatibility with ABI 3.0.1 + @wx_abi_version = [ @wx_version, "3.0.1" ].min @wx_cppflags << "-DwxABI_VERSION=%s" % @wx_abi_version.tr(".", "0") end end From 3b32495b01444b09de4984ae3e70c960acbfbad3 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 17 Mar 2024 09:41:36 +0100 Subject: [PATCH 12/17] fix wxwidgets version check on WXMSW --- .github/workflows/msw.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msw.yml b/.github/workflows/msw.yml index 36cb89bd..95fc6bf3 100644 --- a/.github/workflows/msw.yml +++ b/.github/workflows/msw.yml @@ -220,7 +220,7 @@ jobs: if: matrix.wxw_type == 'embed' run: | If ("${{ matrix.wxr_type }}" -eq "develop") { - bundle exec rake wxruby:exec[ruby,-r,wx,-e,"\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'\""] + bundle exec rake "wxruby:exec[ruby,-r,wx,-e,\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'\"]" } Else { ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'" From be291e2c3ffefa0f30c3c6232a5e90bc3b3cbc92 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 17 Mar 2024 09:44:13 +0100 Subject: [PATCH 13/17] fix wxwidgets version check on WXMSW --- .github/workflows/msw.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msw.yml b/.github/workflows/msw.yml index 95fc6bf3..0a317517 100644 --- a/.github/workflows/msw.yml +++ b/.github/workflows/msw.yml @@ -220,7 +220,7 @@ jobs: if: matrix.wxw_type == 'embed' run: | If ("${{ matrix.wxr_type }}" -eq "develop") { - bundle exec rake "wxruby:exec[ruby,-r,wx,-e,\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'\"]" + bundle exec rake "wxruby:exec[ruby,-r,wx,-e,'fail \"ERROR\" unless Wx::WXWIDGETS_VERSION == \"$env:WXWIDGETS_LATEST_STABLE\"']" } Else { ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'" From 1e2bc30be39994abc9f6ece1569a33a34c8483d0 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 17 Mar 2024 17:13:45 +0100 Subject: [PATCH 14/17] fix wxwidgets version check on WXMSW (another attempt) --- .github/workflows/msw.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msw.yml b/.github/workflows/msw.yml index 0a317517..7d89d330 100644 --- a/.github/workflows/msw.yml +++ b/.github/workflows/msw.yml @@ -220,7 +220,7 @@ jobs: if: matrix.wxw_type == 'embed' run: | If ("${{ matrix.wxr_type }}" -eq "develop") { - bundle exec rake "wxruby:exec[ruby,-r,wx,-e,'fail \"ERROR\" unless Wx::WXWIDGETS_VERSION == \"$env:WXWIDGETS_LATEST_STABLE\"']" + bundle exec rake "wxruby:exec[ruby,-r,wx,-e,'fail \\"ERROR\\" unless Wx::WXWIDGETS_VERSION == \\"$env:WXWIDGETS_LATEST_STABLE\\"']" } Else { ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'" From 9a74c448f9c4273e0dba0b0b55bcaad7ebee3af1 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Mon, 18 Mar 2024 09:02:07 +0100 Subject: [PATCH 15/17] refactor wxwidgets version check --- .github/workflows/linux.yml | 4 ++-- .github/workflows/mac.yml | 4 ++-- .github/workflows/msw.yml | 4 ++-- tools/check_wxw_version.rb | 3 +++ 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 tools/check_wxw_version.rb diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e921b388..4fe63041 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -291,9 +291,9 @@ jobs: if: matrix.wxw_type == 'embed' run: | if [ "${{ matrix.wxr_type }}" == "develop" ]; then - bundle exec rake wxruby:exec[ruby,-r,wx,-e,"\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'\""] + bundle exec rake wxruby:exec[ruby,tools/check_wxw_version.rb,$env:WXWIDGETS_LATEST_STABLE] else - ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'" + ruby tools/check_wxw_version.rb "$env:WXWIDGETS_LATEST_STABLE" fi - name: Run wxRuby3 regression tests diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index a7d148b9..0a438d79 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -333,9 +333,9 @@ jobs: if: matrix.wxw_type == 'embed' run: | if [ "${{ matrix.wxr_type }}" == "develop" ]; then - bundle exec rake wxruby:exec[ruby,-r,wx,-e,"\"fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'\""] + bundle exec rake wxruby:exec[ruby,tools/check_wxw_version.rb,$env:WXWIDGETS_LATEST_STABLE] else - ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$WXWIDGETS_LATEST_STABLE'" + ruby tools/check_wxw_version.rb "$env:WXWIDGETS_LATEST_STABLE" fi - name: Run wxRuby3 regression tests diff --git a/.github/workflows/msw.yml b/.github/workflows/msw.yml index 7d89d330..ef434656 100644 --- a/.github/workflows/msw.yml +++ b/.github/workflows/msw.yml @@ -220,10 +220,10 @@ jobs: if: matrix.wxw_type == 'embed' run: | If ("${{ matrix.wxr_type }}" -eq "develop") { - bundle exec rake "wxruby:exec[ruby,-r,wx,-e,'fail \\"ERROR\\" unless Wx::WXWIDGETS_VERSION == \\"$env:WXWIDGETS_LATEST_STABLE\\"']" + bundle exec rake "wxruby:exec[ruby,tools/check_wxw_version.rb,$env:WXWIDGETS_LATEST_STABLE]" } Else { - ruby -r wx -e "fail 'ERROR' unless Wx::WXWIDGETS_VERSION == '$env:WXWIDGETS_LATEST_STABLE'" + ruby tools/check_wxw_version.rb "$env:WXWIDGETS_LATEST_STABLE" } - name: Run wxRuby3 regression tests diff --git a/tools/check_wxw_version.rb b/tools/check_wxw_version.rb new file mode 100644 index 00000000..338aee0c --- /dev/null +++ b/tools/check_wxw_version.rb @@ -0,0 +1,3 @@ + +require 'wx' +fail 'ERROR' unless Wx::WXWIDGETS_VERSION == ARGV[0] From 683cc6528c9ac978c2ddb96a7bae9ee0ad801d27 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Mon, 18 Mar 2024 11:11:09 +0100 Subject: [PATCH 16/17] improve error message --- tools/check_wxw_version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check_wxw_version.rb b/tools/check_wxw_version.rb index 338aee0c..93dcdf9a 100644 --- a/tools/check_wxw_version.rb +++ b/tools/check_wxw_version.rb @@ -1,3 +1,3 @@ require 'wx' -fail 'ERROR' unless Wx::WXWIDGETS_VERSION == ARGV[0] +fail "ERROR: Expected #{ARGV[0]} but is #{Wx::WXWIDGETS_VERSION}" unless Wx::WXWIDGETS_VERSION == ARGV[0] From 2198588530438bf6e22a1be7e627b1df3b699dec Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Mon, 18 Mar 2024 13:30:04 +0100 Subject: [PATCH 17/17] fix typos --- .github/workflows/linux.yml | 4 ++-- .github/workflows/mac.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4fe63041..221c7297 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -291,9 +291,9 @@ jobs: if: matrix.wxw_type == 'embed' run: | if [ "${{ matrix.wxr_type }}" == "develop" ]; then - bundle exec rake wxruby:exec[ruby,tools/check_wxw_version.rb,$env:WXWIDGETS_LATEST_STABLE] + bundle exec rake wxruby:exec[ruby,tools/check_wxw_version.rb,$WXWIDGETS_LATEST_STABLE] else - ruby tools/check_wxw_version.rb "$env:WXWIDGETS_LATEST_STABLE" + ruby tools/check_wxw_version.rb "$WXWIDGETS_LATEST_STABLE" fi - name: Run wxRuby3 regression tests diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 0a438d79..e658767c 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -333,9 +333,9 @@ jobs: if: matrix.wxw_type == 'embed' run: | if [ "${{ matrix.wxr_type }}" == "develop" ]; then - bundle exec rake wxruby:exec[ruby,tools/check_wxw_version.rb,$env:WXWIDGETS_LATEST_STABLE] + bundle exec rake wxruby:exec[ruby,tools/check_wxw_version.rb,$WXWIDGETS_LATEST_STABLE] else - ruby tools/check_wxw_version.rb "$env:WXWIDGETS_LATEST_STABLE" + ruby tools/check_wxw_version.rb "$WXWIDGETS_LATEST_STABLE" fi - name: Run wxRuby3 regression tests