wxruby3 0.9.5 → 0.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +315 -78
  3. data/README.md +31 -20
  4. data/lib/wx/core/ext.rb +22 -3
  5. data/lib/wx/version.rb +1 -1
  6. data/lib/wx/wxruby/base.rb +6 -4
  7. data/lib/wx/wxruby/cmd/sampler.rb +39 -29
  8. data/lib/wx/wxruby/cmd/setup.rb +122 -0
  9. data/lib/wx/wxruby/cmd/test.rb +56 -6
  10. data/rakefile +14 -0
  11. data/rakelib/bin.rake +48 -0
  12. data/rakelib/bin.rb +62 -0
  13. data/rakelib/build.rb +11 -7
  14. data/rakelib/config.rake +3 -1
  15. data/rakelib/configure.rb +28 -8
  16. data/rakelib/doc.rake +3 -1
  17. data/rakelib/gem.rake +169 -0
  18. data/rakelib/gem.rb +82 -0
  19. data/rakelib/install.rb +2 -0
  20. data/rakelib/lib/config/linux.rb +24 -2
  21. data/rakelib/lib/config/macosx.rb +16 -0
  22. data/rakelib/lib/config/mingw.rb +133 -9
  23. data/rakelib/lib/config/pkgman/arch.rb +53 -0
  24. data/rakelib/lib/config/pkgman/base.rb +169 -0
  25. data/rakelib/lib/config/pkgman/debian.rb +66 -0
  26. data/rakelib/lib/config/pkgman/macosx.rb +183 -0
  27. data/rakelib/lib/config/pkgman/rhel.rb +54 -0
  28. data/rakelib/lib/config/pkgman/suse.rb +54 -0
  29. data/rakelib/lib/config/unixish.rb +36 -19
  30. data/rakelib/lib/config.rb +254 -61
  31. data/rakelib/lib/core/package.rb +47 -49
  32. data/rakelib/lib/director/gdicommon.rb +1 -2
  33. data/rakelib/lib/generate/doc.rb +29 -14
  34. data/rakelib/lib/generate/interface.rb +4 -2
  35. data/rakelib/lib/swig_runner.rb +11 -11
  36. data/rakelib/prepost.rake +9 -4
  37. data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +14 -0
  38. data/rakelib/yard/templates/default/fulldoc/html/setup.rb +5 -5
  39. data/rakelib/yard/yard/relative_markdown_links.rb +7 -1
  40. metadata +21 -17
  41. data/ext/mkrf_conf_srcgem.rb +0 -67
  42. data/rakelib/run.rake +0 -52
@@ -10,44 +10,54 @@ require 'fileutils'
10
10
  module WxRuby
11
11
  module Commands
12
12
  class Sampler
13
- OPTIONS = {
14
- save_path: nil
15
- }
13
+
14
+ DESC = 'Run wxRuby3 Sampler application (or copy samples).'
16
15
 
17
16
  def self.description
18
- " sampler [help]|[copy DEST]\tRun wxRuby3 Sampler application (or copy samples)."
17
+ " sampler -h|[options]\t\t#{DESC}"
18
+ end
19
+
20
+ def self.options
21
+ Commands.options['sampler'] ||= { verbose: Commands.options[:verbose] }
22
+ end
23
+
24
+ def self.parse_args(args)
25
+ opts = OptionParser.new
26
+ opts.banner = "#{DESC}\n\nUsage: wxruby sampler -h|--help OR wxruby sampler [options]\n\n" +
27
+ "Runs the sampler application if no options specified.\n\n"
28
+ opts.separator ''
29
+ opts.on('--copy=DEST',
30
+ 'Copies the included wxRuby sample folders under the directory indicated by DEST (MUST exist)') {|v| Sampler.options[:copy] << v }
31
+ opts.on('-h', '--help',
32
+ 'Show this message.') do |v|
33
+ puts opts
34
+ puts
35
+ exit(0)
36
+ end
37
+ opts.parse!(args)
19
38
  end
20
39
 
21
40
  def self.run(argv)
22
- if argv == :describe
23
- description
24
- else
25
- if argv.empty?
26
- exec(RUBY, File.join(WxRuby::ROOT, 'samples', 'sampler.rb'))
27
- else
28
- arg = argv.shift
29
- if arg == 'help'
30
- puts 'Usage: wxruby [global options] sampler [help]|[copy DEST]'
31
- puts
32
- puts ' Starts the sampler application if called without arguments.'
33
- puts ' Otherwise shows this help for argument "help" or copies the included wxRuby'
34
- puts ' sample folders under the directory indicated by DEST for argument "copy DEST".'
35
- puts ' The directory indicated by DEST *must* already exist.'
36
- puts
37
- elsif arg == 'copy'
38
- unless File.directory?(dest = argv.shift)
39
- STDERR.puts "ERROR: Invalid destination folder #{dest}"
40
- exit(1)
41
- end
42
- Dir[File.join(WxRuby::ROOT, 'samples', '*')].each do |fp|
43
- FileUtils.cp_r(fp, dest, verbose: true)
44
- end
45
- end
41
+ return description if argv == :describe
42
+
43
+ parse_args(argv)
44
+
45
+ if options[:copy]
46
+ unless File.directory?(dest = options[:copy])
47
+ $stderr.puts "ERROR: Invalid destination folder #{dest}"
48
+ exit(1)
46
49
  end
50
+ Dir[File.join(WxRuby::ROOT, 'samples', '*')].each do |fp|
51
+ FileUtils.cp_r(fp, dest, verbose: true)
52
+ end
53
+ else
54
+ exec(RUBY, File.join(WxRuby::ROOT, 'samples', 'sampler.rb'))
47
55
  end
48
56
  end
49
57
  end
50
58
 
51
- self.register('sampler', Sampler)
59
+ if self.setup_done?
60
+ self.register('sampler', Sampler)
61
+ end
52
62
  end
53
63
  end
@@ -0,0 +1,122 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ # wxruby setup command handler
6
+ #--------------------------------------------------------------------
7
+
8
+ require 'fileutils'
9
+
10
+ module WxRuby
11
+ module Commands
12
+ class Setup
13
+
14
+ DESC = 'Run wxRuby3 post-install setup.'
15
+
16
+ def self.description
17
+ " setup -h|[options]\t\t#{DESC}"
18
+ end
19
+
20
+ def self.options
21
+ Commands.options['setup'] ||= { verbose: Commands.options[:verbose] }
22
+ end
23
+
24
+ def self.parse_args(args)
25
+ opts = OptionParser.new
26
+ opts.banner = "#{DESC}\n\nUsage: wxruby setup -h|--help OR wxruby setup [options]\n\n"
27
+ opts.separator ''
28
+ opts.on('--wxwin=path',
29
+ "the installation root for the wxWidgets libraries and headers if not using the system default") {|v| Setup.options['wxwin'] = File.expand_path(v)}
30
+ opts.on('--wxxml=path',
31
+ "the path to the doxygen generated wxWidgets XML interface specs if not using bootstrap") {|v| Setup.options['wxxml'] = File.expand_path(v)}
32
+ opts.on('--with-wxwin',
33
+ "build a local copy of wxWidgets for use with wxRuby [false]") {|v| Setup.options['with-wxwin'] = true}
34
+ opts.on('--swig=path',
35
+ "the path to swig executable [swig]") {|v| Setup.options['swig'] = v}
36
+ opts.on('--doxygen=path',
37
+ "the path to doxygen executable [doxygen]") {|v| Setup.options['doxygen'] = v}
38
+ opts.on('--git=path',
39
+ "the path to git executable [git]") {|v| Setup.options['git'] = v}
40
+ opts.on('--[no-]autoinstall',
41
+ "do (not) attempt to automatically install any required packages") {|v| Setup.options['autoinstall'] = !!v }
42
+ opts.on('--log=PATH',
43
+ "write log to PATH/setup.log (PATH must exist) and do not remove when finished") {|v| Setup.options['log'] = v }
44
+ opts.on('-h', '--help',
45
+ 'Show this message.') do |v|
46
+ puts opts
47
+ puts
48
+ exit(0)
49
+ end
50
+ opts.parse!(args)
51
+ end
52
+
53
+ def self.run(argv)
54
+ return description if argv == :describe
55
+
56
+ parse_args(argv)
57
+
58
+ cfg_args = []
59
+ cfg_args << "--wxwin=#{Setup.options['wxwin']}" if Setup.options['wxwin']
60
+ cfg_args << "--wxxml=#{Setup.options['wxxml']}" if Setup.options['wxxml']
61
+ cfg_args << '--with-wxwin' if Setup.options['with-wxwin']
62
+ cfg_args << "--swig=#{Setup.options['swig']}" if Setup.options['swig']
63
+ cfg_args << "--doxygen=#{Setup.options['doxygen']}" if Setup.options['doxygen']
64
+ cfg_args << "--git=#{Setup.options['git']}" if Setup.options['git']
65
+ unless Setup.options['autoinstall'].nil?
66
+ cfg_args << (Setup.options['autoinstall'] ? '--autoinstall' : '--no-autoinstall')
67
+ end
68
+ cfg_cmd = 'rake configure'
69
+ cfg_cmd << "[#{cfg_args.join(',')}]" unless cfg_args.empty?
70
+
71
+ result = false
72
+ FileUtils.chdir(WxRuby::ROOT) do
73
+ steps = 0
74
+ actions_txt = if Setup.options['autoinstall'] != false
75
+ steps = 1
76
+ '(possibly) install required software'
77
+ else
78
+ ''
79
+ end
80
+ if Setup.options['with-wxwin'] || Setup.options['wxwin'].nil?
81
+ actions_txt << ', ' if steps>0
82
+ actions_txt << 'build the wxWidgets libraries (if needed), '
83
+ actions_txt << "\n" if steps>0
84
+ steps += 1
85
+ else
86
+ actions_txt << ',' if steps>0
87
+ end
88
+ actions_txt << 'build the native wxRuby3 extensions '
89
+ actions_txt << "\n" if steps==1
90
+ actions_txt << 'and generate the wxRuby3 reference documentation.'
91
+ $stdout.puts <<~__INFO_TXT
92
+
93
+ ---
94
+ Now running wxRuby3 post-install setup.
95
+ This will #{actions_txt}
96
+ Please be patient as this may take quite a while depending on your system.
97
+ ---
98
+
99
+ __INFO_TXT
100
+ log_file = File.join(WxRuby::ROOT, 'setup.log')
101
+ if Setup.options['log']
102
+ if File.directory?(Setup.options['log']) && File.writable?(Setup.options['log'])
103
+ log_file = File.join(Setup.options['log'], 'setup.log')
104
+ else
105
+ $stderr.puts "ERROR: cannot write log to #{Setup.options['log']}. Log path must exist and be writable."
106
+ exit(1)
107
+ end
108
+ end
109
+ run_env = {'WXRUBY_RUN_SILENT' => "#{log_file}"}
110
+ run_env['WXRUBY_VERBOSE'] = '1' if Setup.options[:verbose]
111
+ # can't rely on FileUtils#chdir returning the block result (bug in older Rubies) so assign result here
112
+ result = system(run_env, "#{cfg_cmd} && rake -m wxruby:gem:setup#{Setup.options['log'] ? '[:keep_log]' : ''} && gem rdoc wxruby3 --overwrite")
113
+ end
114
+ exit(result ? 0 : 1)
115
+ end
116
+ end
117
+
118
+ unless self.setup_done?
119
+ self.register('setup', Setup)
120
+ end
121
+ end
122
+ end
@@ -10,21 +10,71 @@ require 'fileutils'
10
10
  module WxRuby
11
11
  module Commands
12
12
  class Test
13
+
14
+ DESC = 'Run wxRuby3 regression tests.'
15
+
13
16
  def self.description
14
- " test\t\t\tRun wxRuby3 regression tests."
17
+ " test -h|[options] [TEST [...]]\t#{DESC}"
18
+ end
19
+
20
+ def self.options
21
+ Commands.options['test'] ||= { verbose: Commands.options[:verbose], excludes: [] }
22
+ end
23
+
24
+ def self.parse_args(args)
25
+ opts = OptionParser.new
26
+ opts.banner = "#{DESC}\n\nUsage: wxruby test -h|--help OR wxruby test [options] [TEST [...]]\n\n" +
27
+ "TEST == test name\n" +
28
+ "Runs all tests (except any specified to exclude) if no test specified.\n\n"
29
+ opts.separator ''
30
+ opts.on('--list',
31
+ "display the list of names of the installed tests") do |v|
32
+ tests = Dir[File.join(WxRuby::ROOT, 'tests', '*.rb')].collect { |t| File.basename(t, '.*') }
33
+ $stdout.puts <<~__INFO
34
+ Installed wxRuby tests:
35
+ #{tests.join(', ')}
36
+
37
+ __INFO
38
+ exit(0)
39
+ end
40
+ opts.on('--exclude=TEST',
41
+ "exclude the specified test from running") {|v| Test.options[:excludes] << v }
42
+ opts.on('-h', '--help',
43
+ 'Show this message.') do |v|
44
+ puts opts
45
+ puts
46
+ exit(0)
47
+ end
48
+ opts.parse!(args)
15
49
  end
16
50
 
17
51
  def self.run(argv)
18
- if argv == :describe
19
- description
20
- else
21
- Dir[File.join(WxRuby::ROOT, 'tests', '*.rb')].each do |test|
52
+ return description if argv == :describe
53
+
54
+ parse_args(argv)
55
+
56
+ tests = if argv.empty?
57
+ Dir[File.join(WxRuby::ROOT, 'tests', '*.rb')]
58
+ else
59
+ argv.collect do |a|
60
+ fn = File.join(WxRuby::ROOT, 'tests', a+'.rb')
61
+ unless File.file?(fn)
62
+ $stderr.puts "ERROR: Invalid test [#{a}] specified."
63
+ exit(1)
64
+ end
65
+ fn
66
+ end
67
+ end
68
+ tests.each do |test|
69
+ unless Test.options[:excludes].include?(File.basename(test, '.*'))
22
70
  exit(1) unless system(RUBY, test)
23
71
  end
24
72
  end
25
73
  end
26
74
  end
27
75
 
28
- self.register('test', Test)
76
+ if self.setup_done?
77
+ self.register('test', Test)
78
+ end
29
79
  end
30
80
  end
data/rakefile ADDED
@@ -0,0 +1,14 @@
1
+ ###
2
+ # wxRuby3 rake file
3
+ # Copyright (c) M.J.N. Corino, The Netherlands
4
+ ###
5
+
6
+ # Influential environment variables
7
+ # WXRUBY_VERBOSE : define verbosity for (rake) build scripts
8
+ # WXRUBY_VERSION : define the version info (x.x.x) for this tree
9
+ # WXRUBY_EXCLUDED : exclude certain classes from being compiled, even if present
10
+ #
11
+ # WXWIN : install folder of wxWidgets library if not system default
12
+ # WXXML : folder containing doxygen generated wxWidgets XML interface specs if not using wxRuby bootstrap
13
+
14
+ task :default => 'wxruby:help'
data/rakelib/bin.rake ADDED
@@ -0,0 +1,48 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ ###
6
+ # wxRuby3 rake file
7
+ ###
8
+
9
+ require 'rake/clean'
10
+
11
+ require_relative './bin'
12
+
13
+ directory 'bin'
14
+
15
+ file File.join('bin', 'wxruby') => 'bin' do |t|
16
+ File.open(t.name, 'w') { |f| f.puts WXRuby3::Bin.wxruby }
17
+ File.chmod(0755, t.name)
18
+ end
19
+
20
+ namespace :wxruby do
21
+
22
+ namespace :bin do
23
+
24
+ task :build => ['wxruby:bin:check', File.join('bin', 'wxruby')]
25
+
26
+ task :check do
27
+ WXRuby3::Bin.binaries.each do |bin|
28
+ if File.exist?(File.join('bin', bin))
29
+ content = IO.read(File.join('bin', bin))
30
+ rm_f(File.join('bin', bin)) unless content == WXRuby3::Bin.__send__(bin.gsub('.','_').to_sym)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ CLOBBER.include File.join('bin', 'wxruby')
38
+
39
+ if WXRuby3.config.windows?
40
+
41
+ file File.join('bin', 'wxruby.bat') => ['bin'] do |t|
42
+ File.open(t.name, 'w') { |f| f.puts WXRuby3::Bin.wxruby_bat }
43
+ end
44
+ Rake::Task['wxruby:bin:build'].enhance [File.join('bin', 'wxruby.bat')]
45
+
46
+ CLOBBER.include File.join('bin', 'wxruby.bat')
47
+
48
+ end
data/rakelib/bin.rb ADDED
@@ -0,0 +1,62 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ ###
6
+ # wxRuby3 rake bin support
7
+ ###
8
+
9
+ require_relative './lib/config'
10
+
11
+ module WXRuby3
12
+
13
+ module Bin
14
+
15
+ class << self
16
+ def wxruby
17
+ <<~_SH_TXT
18
+ #!#{WXRuby3.config.windows? ? '/bin/' : (`which env`).strip+' '}#{RB_CONFIG['ruby_install_name']}
19
+ #---------------------------------
20
+ # This file is generated
21
+ #---------------------------------
22
+ module WxRuby
23
+ ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
24
+ end
25
+ require 'wx/wxruby/base'
26
+ WxRuby.run
27
+ _SH_TXT
28
+ end
29
+
30
+ def wxruby_bat
31
+ <<~_BAT_TXT
32
+ @echo off
33
+ if not "%~f0" == "~f0" goto WinNT
34
+ #{RB_CONFIG['ruby_install_name']} -Sx "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
35
+ goto endofruby
36
+ :WinNT
37
+ if not exist "%~d0%~p0#{RB_CONFIG['ruby_install_name']}" goto rubyfrompath
38
+ if exist "%~d0%~p0#{RB_CONFIG['ruby_install_name']}" "%~d0%~p0#{RB_CONFIG['ruby_install_name']}" -x "%~f0" %*
39
+ goto endofruby
40
+ :rubyfrompath
41
+ #{RB_CONFIG['ruby_install_name']} -x "%~f0" %*
42
+ goto endofruby
43
+ #!/bin/#{RB_CONFIG['ruby_install_name']}
44
+ #
45
+ module WxRuby
46
+ ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
47
+ end
48
+ require 'wx/wxruby/base'
49
+ WxRuby.run
50
+ __END__
51
+ :endofruby
52
+ _BAT_TXT
53
+ end
54
+
55
+ def binaries
56
+ %w{wxruby}
57
+ end
58
+ end
59
+
60
+ end
61
+
62
+ end
data/rakelib/build.rb CHANGED
@@ -11,8 +11,11 @@ require_relative './lib/config'
11
11
 
12
12
  if WXRuby3.is_bootstrapped?
13
13
 
14
- Rake.application.options.always_multitask =
15
- Rake.application.top_level_tasks.size == 1 && Rake.application.top_level_tasks.first == 'build'
14
+ # only if not part of installed Gem
15
+ if File.file?(File.join(__dir__, 'package.rake'))
16
+ Rake.application.options.always_multitask =
17
+ Rake.application.top_level_tasks.size == 1 && Rake.application.top_level_tasks.first == 'build'
18
+ end
16
19
 
17
20
  require_relative './lib/director'
18
21
 
@@ -102,22 +105,23 @@ if WXRuby3.is_bootstrapped?
102
105
 
103
106
  file WXRuby3::Director.enum_cache_control_path do |t_|
104
107
  WXRuby3::Director.all_packages.each { |p| p.extract(genint: false) }
105
- touch(WXRuby3::Director.enum_cache_control_path)
108
+ touch(WXRuby3::Director.enum_cache_control_path, verbose: !WXRuby3.config.run_silent?)
106
109
  end
107
110
 
108
111
  # Compile an object file from a generated c++ source
109
112
  rule ".#{WXRuby3.config.obj_ext}" => [
110
113
  proc { |tn| "#{WXRuby3.config.src_dir}/#{File.basename(tn, ".*")}.cpp" }
111
114
  ] do | t |
112
- sh "#{WXRuby3.config.cpp} -c #{WXRuby3.config.verbose_flag} " +
113
- "#{WXRuby3.config.cxxflags} #{WXRuby3::Director.cpp_flags(t.source)} " +
114
- "#{WXRuby3.config.cpp_out_flag}#{t.name} #{t.source}"
115
+ WXRuby3.config.sh "#{WXRuby3.config.cpp} -c #{WXRuby3.config.verbose_flag} " +
116
+ "#{WXRuby3.config.cxxflags} #{WXRuby3::Director.cpp_flags(t.source)} " +
117
+ "#{WXRuby3.config.cpp_out_flag}#{t.name} #{t.source}",
118
+ fail_on_error: true
115
119
  end
116
120
 
117
121
  if WXRuby3.config.windows?
118
122
  # compile an object file from the standard wxRuby resource file
119
123
  file File.join(WXRuby3.config.obj_dir, 'wx_rc.o') => File.join(WXRuby3.config.swig_dir, 'wx.rc') do |t|
120
- sh "#{WXRuby3.config.rescomp} -i#{t.source} -o#{t.name}"
124
+ WXRuby3.config.sh "#{WXRuby3.config.rescomp} -i#{t.source} -o#{t.name}", fail_on_error: true
121
125
  end
122
126
  end
123
127
 
data/rakelib/config.rake CHANGED
@@ -33,7 +33,9 @@ namespace :wxruby do
33
33
  end
34
34
 
35
35
  WXRuby3.config.build_paths.each do |p|
36
- directory p
36
+ directory p do
37
+ mkdir_p(p, verbose: !WXRuby3.config.run_silent?)
38
+ end
37
39
  end
38
40
  end
39
41
 
data/rakelib/configure.rb CHANGED
@@ -70,6 +70,10 @@ module WXRuby3
70
70
  "the path to swig executable [#{get_config('swig')}]") {|v| CONFIG['swig'] = v}
71
71
  opts.on('--doxygen=path',
72
72
  "the path to doxygen executable [#{get_config('doxygen')}]") {|v| CONFIG['doxygen'] = v}
73
+ opts.on('--git=path',
74
+ "the path to git executable [#{get_config('git')}]") {|v| CONFIG['git'] = v}
75
+ opts.on('--[no-]autoinstall',
76
+ "do (not) attempt to automatically install any required packages") {|v| CONFIG['autoinstall'] = !!v }
73
77
 
74
78
  opts.separator ""
75
79
 
@@ -110,20 +114,36 @@ module WXRuby3
110
114
  # check wxWidgets availability through 'wx-config' command
111
115
  if instance.check_wx_config
112
116
  if instance.wx_config("--version") < '3.2.0'
113
- STDERR.puts "ERROR: Incompatible wxWidgets version. wxRuby requires a wxWidgets >= 3.2.0 release."
114
- exit(1)
117
+ if get_cfg_string('wxwin').empty? && get_cfg_string('wxxml').empty?
118
+ # no custom wxWidgets build specified so switch to assuming we should include building wxWidgets ourselves
119
+ set_config('with-wxwin', true)
120
+ else
121
+ # if someone wants to customize they HAVE to do it right
122
+ STDERR.puts "ERROR: Incompatible wxWidgets version. wxRuby requires a wxWidgets >= 3.2.0 release."
123
+ exit(1)
124
+ end
115
125
  end
116
126
  else
117
- STDERR.puts "ERROR: Cannot find wxWidgets. wxRuby requires a wxWidgets >= 3.2.0 release."
118
- exit(1)
127
+ if get_cfg_string('wxwin').empty? && get_cfg_string('wxxml').empty?
128
+ # no custom wxWidgets build specified so switch to assuming we should include building wxWidgets ourselves
129
+ set_config('with-wxwin', true)
130
+ else
131
+ # if someone wants to customize they HAVE to do it right
132
+ STDERR.puts "ERROR: Cannot find wxWidgets. wxRuby requires a wxWidgets >= 3.2.0 release."
133
+ exit(1)
134
+ end
119
135
  end
120
136
  # else we're are assumed to build wxWidgets ourselves so cannot test anything yet
121
137
  end
122
138
 
123
- if get_cfg_string('wxxml').empty?
124
- # no pre-generated XML specified so we are going to need Git and Doxygen
125
- instance.check_git
126
- instance.check_doxygen
139
+ if get_cfg_string('wxxml').empty? && !get_cfg_string('wxwin').empty?
140
+ # in case of a custom wxWidgets build and no explicit xml path check if the custom build holds this
141
+ xml_path = File.join(get_cfg_string('wxwin'), 'docs', 'doxygen', 'out', 'xml')
142
+ # if not there see if the standard setup 'wxw_root/<install dir>' was used
143
+ xml_path = File.join(get_cfg_string('wxwin'), '..', 'docs', 'doxygen', 'out', 'xml') unless File.directory?(xml_path)
144
+ if File.directory?(xml_path) && !Dir.glob(File.join(xml_path, '*.xml')).empty?
145
+ set_config('wxxml', xml_path)
146
+ end
127
147
  end
128
148
 
129
149
  end
data/rakelib/doc.rake CHANGED
@@ -16,7 +16,9 @@ namespace :wxruby do
16
16
 
17
17
  end
18
18
 
19
- directory WXRuby3.config.rb_docgen_path
19
+ directory WXRuby3.config.rb_docgen_path do
20
+ mkdir_p(WXRuby3.config.rb_docgen_path, verbose: !WXRuby3.config.run_silent?)
21
+ end
20
22
 
21
23
  file File.join(WXRuby3.config.rb_docgen_path, 'window.rb') => [WXRuby3.config.rb_docgen_path, *all_doc_targets]
22
24