Class: NxBuild::Project
- Inherits:
-
Object
- Object
- NxBuild::Project
- Defined in:
- lib/nxbuild/project.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
-
#targets_hash ⇒ Object
readonly
Returns the value of attribute targets_hash.
Instance Method Summary collapse
- #_target(name, klass, &block) ⇒ Object
- #cpp_target(name, &block) ⇒ Object
- #import(path) ⇒ Object
-
#initialize ⇒ Project
constructor
A new instance of Project.
- #project(name) ⇒ Object
Constructor Details
#initialize ⇒ Project
Returns a new instance of Project.
9 10 11 12 |
# File 'lib/nxbuild/project.rb', line 9 def initialize @targets = [] @targets_hash = {} end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/nxbuild/project.rb', line 5 def name @name end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
6 7 8 |
# File 'lib/nxbuild/project.rb', line 6 def targets @targets end |
#targets_hash ⇒ Object (readonly)
Returns the value of attribute targets_hash.
7 8 9 |
# File 'lib/nxbuild/project.rb', line 7 def targets_hash @targets_hash end |
Instance Method Details
#_target(name, klass, &block) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/nxbuild/project.rb', line 27 def _target(name, klass, &block) t = klass.new t.name = name t.instance_exec &block @targets << t @targets_hash[name] = t return t end |
#cpp_target(name, &block) ⇒ Object
23 24 25 |
# File 'lib/nxbuild/project.rb', line 23 def cpp_target(name, &block) _target(name, Target::Cpp, &block) end |
#import(path) ⇒ Object
18 19 20 21 |
# File 'lib/nxbuild/project.rb', line 18 def import(path) buffer = File.read(path) self.instance_eval(buffer, path, 1) end |
#project(name) ⇒ Object
14 15 16 |
# File 'lib/nxbuild/project.rb', line 14 def project(name) @name = name end |