Class: OSGi::DependenciesTask

Inherits:
Rake::Task
  • Object
show all
Includes:
BundleCollector
Defined in:
lib/buildr4osgi/osgi/project_extension.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes included from BundleCollector

#bundles, #project_dependencies, #projects

Instance Method Summary collapse

Methods included from BundleCollector

#_collect, #collect

Constructor Details

#initialize(*args) ⇒ DependenciesTask

:nodoc:



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/buildr4osgi/osgi/project_extension.rb', line 93

def initialize(*args) #:nodoc:
  super

  enhance do |task|
    _dependencies = {}
    _projects = {}
    project.projects.each do |subp|
      collect(subp)
      _projects[subp.name] = projects.collect {|p| p.name}.uniq.sort
      _dependencies[subp.name] = bundles.collect {|b| b.to_s }.uniq.sort 
    end
    
    collect(project)
    _dependencies[project.name] = bundles.collect {|b| b.to_s }.uniq.sort 
    _projects[project.name] = projects.collect {|p| p.name}.uniq.sort
    
    dependencies = ::OSGi::Dependencies.new(project)
    dependencies.write(_projects.keys) {|hash, p|
      unless _dependencies[p].nil?
        hash[p]["dependencies"] = _dependencies[p]
      end
      unless _projects[p].nil?
        hash[p]["projects"] = _projects[p]
      end
    }
  end
end

Instance Attribute Details

#projectObject

Returns the value of attribute project.



91
92
93
# File 'lib/buildr4osgi/osgi/project_extension.rb', line 91

def project
  @project
end