def modules_component
create_component("ProjectModuleManager") do |xml|
xml.modules do
buildr_project.projects.select { |subp| subp.iml? }.each do |subproject|
module_path = subproject.base_dir.gsub(/^#{buildr_project.base_dir}\//, '')
path = "#{module_path}/#{subproject.iml.name}.iml"
attribs = {:fileurl => "file://$PROJECT_DIR$/#{path}", :filepath => "$PROJECT_DIR$/#{path}"}
if subproject.iml.group == true
attribs[:group] = subproject.parent.name.gsub(':', '/')
elsif !subproject.iml.group.nil?
attribs[:group] = subproject.group.to_s
end
xml.module attribs
end
self.extra_modules.each do |iml_file|
xml.module :fileurl => "file://$PROJECT_DIR$/#{iml_file}",
:filepath => "$PROJECT_DIR$/#{iml_file}"
end
if buildr_project.iml?
xml.module :fileurl => "file://$PROJECT_DIR$/#{buildr_project.iml.name}.iml",
:filepath => "$PROJECT_DIR$/#{buildr_project.iml.name}.iml"
end
end
end
end