Module: Metabuild

Defined in:
lib/metabuild.rb

Overview

This module defines a “meta-make” system in ruby. The goal is to create build directive for a component, along with different targets an depedencies among them ( like in Make). A hierarchical reporting tool is included.

Defined Under Namespace

Classes: Builder, Git, Log, LogHtml, LogText, Options, Target

Constant Summary collapse

CACHE =
ENV.fetch("RBUILD_CACHE", "/work/common/build_cache")
DEFAULT_TAGS =
[
lambda {`uname -p`},
lambda {`uname -o`},
lambda {File.read("/etc/fedora-release") if File.exists? "/etc/fedora-release"},
lambda {s = ""; 1.upto(ARGV.length-1) {|i| s += ARGV[i]};s}
]
DEFAULT_OPTIONS =
{
"clone" => [".", "Path of the SCM clone"],
"cache" => ["no", "Use caching to speed up builds"],
"dependency" => ["yes", "Track dependencies between targets"],
"workspace" => ENV.fetch("WORKSPACE", Dir.pwd),
"logtype" => "text",
"logfile" => "",
"dep_graph" => ["no", "Output Dependency graph in Graphviz dot format"],
"parallel" => ["no", "Run threads in parallel. Make sure that your dependency graph can handle this !"],
"prefix" => ["", "Prefix for the final installation"],
}
METABUILD_VERSION =
0.4

Instance Method Summary collapse

Instance Method Details

#cd!(dir) ⇒ Object

helper function that goes into dir if it exists, or create it and goes into it



78
79
80
81
# File 'lib/metabuild.rb', line 78

def cd!(dir)
  mkdir_p dir unless File.directory? dir
  cd dir
end

#create_goto_dir!(dir) ⇒ Object

helper function that does (rm -rf dir; mkdir dir; cd dir)



71
72
73
74
75
# File 'lib/metabuild.rb', line 71

def create_goto_dir!(dir)
  rm_rf dir
  mkdir_p dir
  cd dir
end

#require_version(ver) ⇒ Object



64
65
66
# File 'lib/metabuild.rb', line 64

def require_version(ver)
  raise "Error, version #{ver} needed (current version is #{METABUILD_VERSION})" unless ver == METABUILD_VERSION
end