Class: Lake::Target
- Inherits:
-
Struct
- Object
- Struct
- Lake::Target
- Defined in:
- lib/lake.rb
Instance Attribute Summary collapse
-
#deps ⇒ Object
Returns the value of attribute deps.
-
#flags ⇒ Object
Returns the value of attribute flags.
-
#name ⇒ Object
Returns the value of attribute name.
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
Instance Attribute Details
#deps ⇒ Object
Returns the value of attribute deps
5 6 7 |
# File 'lib/lake.rb', line 5 def deps @deps end |
#flags ⇒ Object
Returns the value of attribute flags
5 6 7 |
# File 'lib/lake.rb', line 5 def flags @flags end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/lake.rb', line 5 def name @name end |
#proc ⇒ Object
Returns the value of attribute proc
5 6 7 |
# File 'lib/lake.rb', line 5 def proc @proc end |
Instance Method Details
#build(rec = true) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/lake.rb', line 6 def build(rec=true) if need_build? then puts "[INFO] Building #{name}" deps.each{ |e| $targets[e.to_s].build if rec or $targets[e.to_s].flags[:unchecked] } proc.call if proc else puts "[INFO] #{name} is already built" end end |
#need_build? ⇒ Boolean
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lake.rb', line 19 def need_build? for dep in deps do #return true if not $targets[dep.to_s] and not File.exists? dep.to_s #return true if $targets[dep.to_s] and $targets[dep.to_s].need_build? if $targets[dep.to_s] then return true if $targets[dep.to_s].need_build? else return true unless File.exists? dep.to_s end end return true if flags[:unchecked] if flags[:virtual] then return false else return ! File.exists?(name.to_s) end end |