Module: Roby::Rake

Extended by:
Logger::Forward, Logger::Hierarchy
Defined in:
lib/roby/app/rake.rb

Overview

This module contains some tools used in the Rakefile of both Roby core and plugins

Class Method Summary collapse

Class Method Details

.invoke_plugin_target(target) ⇒ Object

Invoke the given target in all plugins found in plugins/ that define it



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/roby/app/rake.rb', line 36

def self.invoke_plugin_target(target)
      ENV['ROBY_ROOT_DIR'] = ROBY_ROOT_DIR
    Dir.new('plugins').each do |plugin_dir|
        next if plugin_dir =~ /^\.{1,2}$/

        plugin_dir = File.join('plugins', plugin_dir)
        if File.file? File.join(plugin_dir, 'Rakefile')
            Dir.chdir(plugin_dir) do
                task_list = `rake --tasks`.split("\n")
                if !task_list.grep(/^rake #{target}(\s|$)/).empty?
                    if !system 'rake', target
                        raise "failed to call rake target #{target} in #{plugin_dir}"
                    end
                end
            end
        end
    end
end

.rdoc_templateObject

Returns the rdoc template path the documentation generation should be using in Rakefile

Two non-standard templates are provided: allison and jamis. The default is jamis. Allison is nicer, but the javascript-based indexes are slow given the count of classes and methods there is in Roby.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/roby/app/rake.rb', line 18

def self.rdoc_template
    if ENV['ROBY_RDOC_TEMPLATE']
        if ENV['ROBY_RDOC_TEMPLATE'] == 'jamis'
            Roby::Rake.info "using in-source jamis template"
            File.expand_path('doc/styles/jamis', ROBY_ROOT_DIR)
        elsif ENV['ROBY_RDOC_TEMPLATE'] == 'allison'
            Roby::Rake.info "using in-source allison template"
            File.expand_path('doc/styles/allison', ROBY_ROOT_DIR)
        else
            Roby::Rake.info "using the #{ENV['ROBY_RDOC_TEMPLATE']} template"
            ENV['ROBY_RDOC_TEMPLATE']
        end
    else
        File.expand_path('doc/styles/jamis', ROBY_ROOT_DIR)
    end
end