Module: Teapot::Build

Defined in:
lib/teapot/build.rb,
lib/teapot/build/graph.rb,
lib/teapot/build/linker.rb,
lib/teapot/build/target.rb,
lib/teapot/build/component.rb,
lib/teapot/build/file_list.rb,
lib/teapot/build/targets/files.rb,
lib/teapot/build/targets/library.rb,
lib/teapot/build/targets/compiler.rb,
lib/teapot/build/targets/external.rb,
lib/teapot/build/targets/directory.rb,
lib/teapot/build/targets/executable.rb,
lib/teapot/build/targets/application.rb

Defined Under Namespace

Modules: Helpers, Linker, Targets Classes: Component, FileList, Target

Constant Summary collapse

@@graphs =
{}

Class Method Summary collapse

Class Method Details

.dependency_graph(environment) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/teapot/build/graph.rb', line 30

def self.dependency_graph(environment)
  @@graphs.fetch(environment) do
    graph = Graph.new

    buildflags = environment[:buildflags]
    roots = Extractors::PreprocessorExtractor.include_directories(buildflags)
  
    # At some point, it would be nice if this process could be driven by environment configuration:
    patterns = [
      /\.c(c|pp)?$/,
      /\.h(pp)?$/,
      /\.mm?/
    ]
  
    graph.extractors << Extractors::PreprocessorExtractor.new(patterns, roots)
    
    @@graphs[environment] = graph
  end
end

.top(path) ⇒ Object



30
31
32
# File 'lib/teapot/build.rb', line 30

def self.top(path)
  Targets::Directory.target(nil, path)
end