require 'build-tool/commands' module BuildTool; module Commands; module Modules # # BuildCommand # class Info < ModuleBasedCommand name "info" description "show detailed information about modules." def do_execute_module( mod ) if mod.repository say "Repository: #{mod.repository.url}/#{mod.remote_path}" if mod.repository.sshkey say " SSH Key: '#{mod.repository.sshkey.name}' (#{mod.repository.sshkey.file})" end else say "Repository: not configured" end if mod.build_prefix say "Local Checkout: #{mod.vcs.local_path} #{mod.checkedout? ? '(EXISTS)' : '(TODO)' }" say "Build Directory #{mod.build_directory} #{mod.configured? ? '(CONFIGURED)' : '(TODO)' }" else say "Local Checkout: build-prefix not configured" say "Local Checkout: build-prefix not configured" end say "Prefix: #{mod.install_prefix.to_s}" if mod.environment say "Environment:" mod.environment.vars.sort.each do |var| say " %-20s %s" % [ var + ":", mod.environment[var] ] end else say "Environment: Not configured" end say "VCS: #{mod.vcs_configuration ? mod.vcs_configuration.name : 'not configured' }" if mod.vcs_configuration case mod.vcs_configuration.name when 'svn' when 'git' say " Remote: %s -> %s" % [ "origin", mod.vcs_configuration.repository.url ] mod.vcs_configuration.remote.each do |key, val| say " Remote: %s -> %s" % [ key, val.url ] end when 'git-svn' mod.vcs_configuration.externals.each do |key, val| say " External: #{key} -> #{val}" end else logger.warn "Unknown vcs #{mod.vcs_configuration.name}" end say " Track branch: #{mod.vcs_configuration.track_remote}/#{mod.vcs_configuration.track_branch}" end # if mod.vcs_configuration bs = mod.build_system say "Build System: #{bs.name}" say " Out Of Source Build #{bs.out_of_source}" bs.options.sort.each do |var| say " %-25s %s" % [ var + ":", bs[var] ] end return 0 end end # class Info end; end; end # module BuildTool::Commands::Modules