class RBT::Action::InferBuildSystem
Public Class Methods
[](i = ARGV)
click to toggle source
new( i = ARGV, run_already = true, &block )
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb, line 27 def initialize( i = ARGV, run_already = true, &block ) reset set_commandline_arguments(i) case run_already # ======================================================================= # # === :do_not_run_yet # ======================================================================= # when :do_not_run_yet run_already = false end run if run_already end
Public Instance Methods
dataset_from_build_systems_priorities?()
click to toggle source
infer_the_build_system_from_this_directory( i = return_pwd )
click to toggle source
#¶ ↑
infer_the_build_system_from_this_directory
¶ ↑
This method will attempt to determine the build system for the given directory (defaulting to the current work directory, if omitted as argument).
The argument to this method should thus be a directory that exists locally.
#¶ ↑
# File lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb, line 110 def infer_the_build_system_from_this_directory( i = return_pwd ) # ======================================================================= # # === Check for the case first where the user must use autoconf # # This should come before the next check for "configure". # ======================================================================= # if does_this_file_exist?("#{i}configure.ac") if meson_build_file_exists?(:default) and meson_has_higher_priority_that_configure? set_use_this_build_system 'meson' else set_use_this_build_system 'configure_requiring_autoconf_step' end # ======================================================================= # # === Check for GNU configure script # # This entry point will check for configure. # ======================================================================= # elsif does_this_file_exist?("#{i}configure") set_use_this_build_system 'configure' # ======================================================================= # # === Handle meson build next (meson tag) # # However had, some programs may have both a configure-script # and meson files. In this case, we have to determine which # one is to be run, which is done within the following # "elsif" clause. # ======================================================================= # elsif meson_build_file_exists?(:default) set_use_this_build_system 'meson' # ======================================================================= # # === Check for a perl Makefile.PL file # ======================================================================= # elsif does_this_file_exist?("#{i}Makefile.PL") set_use_this_build_system 'perl' # ======================================================================= # # === Check for Makefile # # This entry point will be valid for e. g. "man-pages". # ======================================================================= # elsif does_this_file_exist?("#{i}Makefile") set_use_this_build_system 'make' # ======================================================================= # # === Check for oldschool setup.rb files: # ======================================================================= # elsif does_this_file_exist?("#{i}setup.rb") set_use_this_build_system 'setup.rb' # ======================================================================= # # === Handle "setup.py" files next # ======================================================================= # elsif does_this_file_exist?("#{i}FILE_SETUP_PY") and !meson_build_file_exists? set_use_this_build_system 'python' # ======================================================================= # # === It's still python though # ======================================================================= # elsif does_this_file_exist?("#{i}FILE_SETUP_PY") set_use_this_build_system 'python' else e 'Unknown build system.' end end
meson_has_higher_priority_that_configure?()
click to toggle source
#¶ ↑
meson_has_higher_priority_that_configure?¶ ↑
#¶ ↑
# File lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb, line 71 def meson_has_higher_priority_that_configure? array = dataset_from_build_systems_priorities? index1 = array.index('meson') index2 = array.index('configure') return (index1 < index2) end
report_the_build_system()
click to toggle source
#¶ ↑
report_the_build_system
¶ ↑
#¶ ↑
# File lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb, line 176 def report_the_build_system e "#{rev}The build system is #{steelblue(build_system?)}#{rev}." end
Also aliased as: report
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Action#reset
# File lib/rbt/actions/individual_actions/infer_build_system/infer_build_system.rb, line 47 def reset super() infer_the_namespace # ======================================================================= # # === @use_this_build_system # ======================================================================= # set_use_this_build_system(nil) # ======================================================================= # # === :dataset_from_build_systems_priorities # ======================================================================= # _ = RBT.file_build_system_priorities @internal_hash[:dataset_from_build_systems_priorities] = YAML.load_file(_) end
run()
click to toggle source
set_use_this_build_system(i)
click to toggle source