lib/autobuild/config.rb in autobuild-1.2.15 vs lib/autobuild/config.rb in autobuild-1.3.0
- old
+ new
@@ -199,7 +199,39 @@
Rake.application.options.trace = debug
args[0..-1]
end
end
+
+ def self.apply(packages, buildname = "autobuild")
+ if Autobuild.mail[:to]
+ if !Autobuild::HAS_RMAIL
+ STDERR.puts "RMail is not available. Mail notification is disabled"
+ else
+ Reporting << MailReporter.new(Autobuild.mail)
+ end
+ end
+
+ if Autobuild.only_doc
+ phases = ['doc']
+ else
+ phases = ['import']
+ phases += ['prepare', 'build'] if Autobuild.do_build
+ phases << 'doc' if Autobuild.do_doc
+ end
+ phases.each do |phase|
+ # We create a dummy task listing what needs to be done, and then we
+ # call it
+ targets = if packages.empty?
+ phase
+ else
+ packages.map { |pkg| "#{pkg}-#{phase}" }
+ end
+
+ task "#{buildname}-#{phase}" => targets
+ end
+ phases.each do |phase|
+ Rake::Task["#{buildname}-#{phase}"].invoke
+ end
+ end
end