lib/task.rb in distil-0.8.2 vs lib/task.rb in distil-0.8.4

- old
+ new

@@ -115,10 +115,13 @@ return (@need_to_build=true) if !File.exists?(p) File.stat(p).mtime } oldest_product_modification_time= product_modification_times.max + stat= File.stat(Project.current.project_file) + return (@need_to_build=true) if stat.mtime > oldest_product_modification_time + @assets.each { |a| stat= File.stat(a) return (@need_to_build=true) if stat.mtime > oldest_product_modification_time } @@ -162,20 +165,17 @@ } folders.sort! folders.each { |f| - # puts "#{File.join(remove_prefix, f)} => #{File.join(output_folder, f)}" src_folder= remove_prefix ? File.join(remove_prefix, f) : f src_folder= SourceFile.path_relative_to_folder(File.expand_path(src_folder), output_folder) target_folder= File.expand_path(File.join(output_folder, f)) next if File.exists?(target_folder) File.symlink src_folder, target_folder } - - # puts "#{task_name}: folder=#{folders.inspect}" end def copy_assets assets.each { |a| a.copy_to(output_folder, remove_prefix) @@ -187,54 +187,10 @@ copy_assets else symlink_assets end end - - def copy_assets_orig - # puts "\nincluded:" - # @included_files.each { |f| puts f.file_path } - # - # puts "\nordered:" - # @ordered_files.each { |f| puts f.file_path } - # puts "\nassets:" - # assets.each { |a| puts a.file_path } - folders= assets.map { |a| - short_folder_name= File.dirname(a.file_path).split("/")[0] - if ("."==short_folder_name) - [a.file_path, a.relative_to_folder(output_folder)] - else - short_folder_regex= /.*\/#{Regexp.escape(short_folder_name)}\// - # puts "#{a.file_path}: #{short_folder_regex.inspect}: #{a.relative_to_folder(@options.output_folder)}" - relative_folder_name= (a.relative_to_folder(output_folder))[short_folder_regex] - [short_folder_name, relative_folder_name] - end - } - folders.compact! - folders.uniq! - - # puts "\nfolders:" - # folders.each { |f| puts f.inspect } - - folders.each { |f| - target_folder= "#{output_folder}/#{f[0]}" - FileUtils.rm target_folder if File.symlink?(target_folder) - # FileUtils.rm_r target_folder if File.exists?(target_folder) - } - - if ("release"==mode) - assets.each { |a| a.copy_to(output_folder) } - else - folders.each { |f| - # puts "#{f[0]}" - target_folder= "#{output_folder}/#{f[0]}" - source_folder= f[1] - File.symlink source_folder, target_folder - } - end - end - def cleanup end end