Module: Flak::Template::Delight::Tasks

Defined in:
lib/flak/rake/templates/delight.rb

Class Method Summary collapse

Class Method Details

.extended(target) ⇒ Object



89
90
91
# File 'lib/flak/rake/templates/delight.rb', line 89

def self.extended target
  task_factory target
end

.task_factory(target) ⇒ Object



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/flak/rake/templates/delight.rb', line 94

def self.task_factory target
  settings = target.settings



  files = settings[:sl_files]
  unless files.nil?

    files.each do |f|



      # file tasks to build shader from sources
      ######################################################
      target_shader = target.shader_file(f)    
      file target_shader => f  do |t|
        dest = target.make_directory_for(target_shader)
        sh delight_shader_compile_cmd(dest,f) 
      end

      namespace settings[:name].to_sym do        
        desc "build the #{settings[:name].to_sym} delight shaader"
        task :build => target_shader
      end
      task :build => "#{settings[:name].to_sym}:build"
      ######################################################            



      # file tasks to release shaders
      ######################################################
      release_shader = target.shader_release_path(target_shader)
      file release_shader => target_shader do
        target.make_directory_for(release_shader)
        cp target_shader, release_shader 
      end

      namespace settings[:name].to_sym do        
        task :release => release_shader
      end
      task :release => "#{settings[:name].to_sym}:release"
      ######################################################       


    end


    # task to clean the build files
    ######################################################
    namespace settings[:name].to_sym do     
      desc "clean the #{settings[:name].to_sym} build files"
      task :clean do
        sh delight_clean_cmd
      end
    end
    task :clean => "#{settings[:name].to_sym}:clean"
    ######################################################






  end
end