require 'build-tool/application' require 'build-tool/commands' module BuildTool; module Commands; class CtagsError < BuildTool::Error; end # # BuildCommand # class Configure < ModuleBasedCommand include MJ::Tools::SubProcess name "configure" description "configure the module" long_description [ "Invokes the configuration phase for the specified modules." ] # Log this command if $noop is not active def log? ! $noop end def initialize_options @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname} MODULES..." @rmcache = false @from_scratch = false @clean = false @options.separator "Options:" options.on( "--[no-]clean", "Make clean before building." ) { |t| @clean = t } options.on( nil, "--from-scratch", "Rebuild from scratch" ) { |t| @from_scratch = true } options.on( "--rmcache", "Remove cache file." ) { |t| @rmcache = true } super end def applicable? BuildTool::Application.instance.name != "build-tool" end def is_module_ready?( mod ) isready = true if !mod.checkedout? logger.warn "#{mod.name}: module not checked out -> skipping." end return isready end def do_execute_module( mod ) if mod.checkedout? if @from_scratch or @clean clean( mod, @from_scratch ) end if @rmcache and !@from_scratch reconfigure( mod ) else configure( mod ) end else logger.info "Not checked out. Skipping" end end end # class Build end; end # module BuildTool::Commands