Sha256: 6b8e8f59628ab3c44d0d01bec6bdd7a273663966d265ba6ab6df9d273c955cdf

Contents?: true

Size: 1.72 KB

Versions: 5

Compression:

Stored size: 1.72 KB

Contents

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"

        def initialize_options

            @rmcache      = false
            @from_scratch = false
            @clean        = false

            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
                    mod.clean( @log_directory, @from_scratch )
                end

                if @rmcache and !@from_scratch
                    mod.reconfigure( @log_directory )
                else
                    mod.configure( @log_directory )
                end
            else
                logger.info "Not checked out. Skipping"
            end
        end

    end # class Build

end; end # module BuildTool::Commands




Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
build-tool-0.1.4 lib/build-tool/commands/configure.rb
build-tool-0.1.3 lib/build-tool/commands/configure.rb
build-tool-0.1.2 lib/build-tool/commands/configure.rb
build-tool-0.1.0 lib/build-tool/commands/configure.rb
build-tool-0.1.1 lib/build-tool/commands/configure.rb