Class: BuildTool::Commands::Configure

Inherits:
ModuleBasedCommand show all
Includes:
MJ::Tools::SubProcess
Defined in:
lib/build-tool/commands/configure.rb

Overview

BuildCommand

Instance Attribute Summary

Attributes inherited from Base

#cmd, #options, #parent

Instance Method Summary collapse

Methods inherited from ModuleBasedCommand

#clean, #clone, #configure, #do_execute, #fetch, #initialize, #install, #make, #rebase, #reconfigure, #summarize

Methods inherited from Standard

#complete_module, #complete_modules, #initialize, #log_directory, #while_logging_to

Methods inherited from Base

#<=>, #cleanup_after_vcs_access, #complete, #complete_arguments, #complete_readline_1_8, #complete_readline_1_9, #configuration, #do_complete_1_8, #do_complete_1_9, #do_execute, #each_option, #execute, #fullname, #initialize, #say, #setup_command, #show_help, #skip_command, #summarize, #teardown_command, #usage

Methods included from HelpText

#cmdalias, #description, included, #long_description, #name

Constructor Details

This class inherits a constructor from BuildTool::Commands::ModuleBasedCommand

Instance Method Details

#applicable?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/build-tool/commands/configure.rb', line 48

def applicable?
    BuildTool::Application.instance.has_recipe?
end

#do_execute_module(mod) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/build-tool/commands/configure.rb', line 61

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

#initialize_optionsObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/build-tool/commands/configure.rb', line 24

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

#is_module_ready?(mod) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
55
56
57
58
# File 'lib/build-tool/commands/configure.rb', line 52

def is_module_ready?( mod )
    isready = true
    if !mod.checkedout?
        logger.warn "#{mod.name}: module not checked out -> skipping."
    end
    return isready
end

#log?Boolean

Log this command if $noop is not active

Returns:

  • (Boolean)


20
21
22
# File 'lib/build-tool/commands/configure.rb', line 20

def log?
    ! $noop
end