Class: Origen::Application::RakeLoader

Inherits:
Object
  • Object
show all
Includes:
Rake::DSL
Defined in:
lib/origen/application.rb

Overview

A simple class to load all rake tasks available to an application, a class is used here to avoid collision with the Rake namespace method

Instance Method Summary collapse

Instance Method Details

#load_tasksObject



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/origen/application.rb', line 107

def load_tasks
  $VERBOSE = nil  # Don't care about world writable dir warnings and the like
  require 'colored'

  # Load all Origen tasks first
  Dir.glob("#{Origen.top}/lib/tasks/*.rake").sort.each do |file|
    load file
  end
  # Now the application's own tasks
  if Origen.app.origen_core?
    Dir.glob("#{Origen.root}/lib/tasks/private/*.rake").sort.each do |file|
      load file
    end
  else
    Dir.glob("#{Origen.root}/lib/tasks/*.rake").sort.each do |file|
      load file
    end
  end
  # Finally those that the plugin's have given us
  ([Origen.app] + Origen.app.plugins).each do |plugin|
    namespace plugin.name do
      Dir.glob("#{plugin.root}/lib/tasks/shared/*.rake").sort.each do |file|
        load file
      end
    end
  end
end