Sha256: 4da64a2ba7f26179289fb51e2508d3be85a00d08a8da14bb36b3c9d5bf5c9b5d

Contents?: true

Size: 1.59 KB

Versions: 2

Compression:

Stored size: 1.59 KB

Contents

#! /usr/bin/env ruby

begin
    require 'daemons'
rescue LoadError
end

require 'autobuild'

include Autobuild

DEFAULT_HTTP_PORT = 2000

# Load the command line options
conffile, *packages = Autobuild.commandline(ARGV)
Autobuild.packages = packages

# make conffile an absolute path since daemonize mode makes
# / the current directory
conffile = File.expand_path(conffile, Dir.pwd)
if Autobuild.daemonize
    puts "Going into daemon mode ..."
    Daemons.daemonize 
end

Reporting << StdoutReporter.new
begin
    Reporting.report do
        load conffile

	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
            targets  = ['doc']
        else
            targets  = ['import']
            targets << 'doc' if Autobuild.do_doc
            targets += ['prepare', 'build'] if Autobuild.do_build
        end
        targets.each do |phase|
	    packages = Autobuild.packages
	    packages = Autobuild.default_packages if packages.empty?

            if packages.empty?
                Rake::Task[phase].invoke
            else
                packages.each do |pkg|
                    Rake::Task["#{pkg}-#{phase}"].invoke
                end
            end
        end

        Reporting.success
    end
rescue ThreadError
    STDERR.puts "Rake failed with a ThreadError"
    STDERR.puts "You may have a circular dependency in your packages"
rescue Interrupt
    STDERR.puts "interrupted"
end
 

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
autobuild-1.2.4 bin/autobuild
autobuild-1.2.5 bin/autobuild