Rakefile in sensible-cinema-0.28.0 vs Rakefile in sensible-cinema-0.28.1

- old
+ new

@@ -8,18 +8,19 @@ s.summary = "an EDL scene-selector/bleeper that works with online players like hulu" s.email = "rogerdpack@gmail.com" s.homepage = "http://github.com/rdp" s.authors = ["Roger Pack"] s.add_dependency 'os', '>= 0.9.4' - s.add_dependency 'sane', '>= 0.24.2' - s.add_dependency 'rdp-win32screenshot', '= 0.0.9' + s.add_dependency 'sane', '>= 0.24.6' + # vendored s.add_dependency 'rdp-win32screenshot', '= 0.0.9' s.add_dependency 'mini_magick', '>= 3.1' # for ocr... s.add_dependency 'whichr', '>= 0.3.6' - s.add_dependency 'rdp-rautomation', '> 0.6.3' # LODO + s.add_dependency 'rdp-rautomation', '> 0.6.3' # LODO use mainline with next release, though I can't remember why s.add_dependency 'rdp-ruby-wmi' # for windows s.add_dependency 'plist' # for mac - s.add_dependency 'ffi' # mouse, etc. needed at least for windows MRI + # jruby-win32ole? + s.add_dependency 'ffi' # mouse, etc. needed for windows MRI, probably jruby too [windows] s.files.exclude '**/*.exe', '**/*.wav', '**/images/*' s.add_development_dependency 'hitimes' # now jruby compat! s.add_development_dependency 'rspec', '> 2' s.add_development_dependency 'jeweler' s.add_development_dependency 'rake' @@ -64,10 +65,11 @@ new_dependencies << transitive_deps } new_dependencies.flatten.uniq end +desc 'clear_and_copy_vendor_cache' task 'clear_and_copy_vendor_cache' do system("rm -rf ../cache.bak") system("cp -r vendor/cache ../cache.bak") # for retrieval later Dir['vendor/cache/*'].each{|f| FileUtils.rm_rf f @@ -100,29 +102,42 @@ existing = Dir['*'] FileUtils.mkdir_p dir_out FileUtils.cp_r(existing, dir_out) # copies files, subdirs in # these belong in the parent dir, by themselves. - FileUtils.cp(Dir["#{dir_out}/template_bats/*.bat"], "#{dir_out}/..") - puts 'still not mac compatible OOTB' -# FileUtils.cp_r(dir_out + '/template_bats/mac', dir_out) - p 'created (still need to zip it) ' + dir_out + root_distro = "#{dir_out}/.." + FileUtils.cp_r(dir_out + '/template_bats/mac', root_distro) # the executable bit carries through somehow.. + FileUtils.cp_r(dir_out + '/template_bats/pc', root_distro) # the executable bit carries through somehow.. + FileUtils.cp('template_bats/README_DISTRO.TXT', root_distro) + p 'created (still need to zips it) ' + dir_out FileUtils.rm_rf Dir[dir_out + '/**/{spec}'] # don't need to distribute those..save 3M! end +def set_executable_bit filename + FileUtils.chmod 0755, filename +end + def cur_ver File.read('VERSION').strip end +def delete_now_packaged_dir name + FileUtils.rm_rf name +end + +desc 'create *.zip,tgz' task 'zip' do name = 'sensible-cinema-' + cur_ver - raise unless File.directory? name + raise 'doesnt exist yet to zip?' unless File.directory? name raise unless system("\"c:\\Program Files\\7-Zip\\7z.exe\" a -tzip -r #{name}.zip #{name}") - FileUtils.rm_rf name - p 'created ' + name + '.zip, and deleted its [from] folder' + raise unless system("tar -cvzf #{name}.tgz #{name}") + delete_now_packaged_dir name + p 'created ' + name + '.zip,tgz and deleted its [create from] folder' end + + def sys arg 3.times { |n| if n > 0 p 'retrying ' + arg end @@ -132,23 +147,25 @@ } raise arg + ' failed 3x!' end task 'deploy' do - name = 'sensible-cinema-' + cur_ver + ".zip" - p 'copying to ilab' - sys "scp #{name} rdp@ilab1.cs.byu.edu:~/incoming" - p 'creating sf shell' - sys "ssh rdp@ilab1.cs.byu.edu 'ssh rogerdpack,sensible-cinema@shell.sourceforge.net create'" # needed for the next command to be able to work [weird] - p 'creating sf dir' - begin - sys "ssh rdp@ilab1.cs.byu.edu 'ssh rogerdpack,sensible-cinema@shell.sourceforge.net \"mkdir /home/frs/project/s/se/sensible-cinema/#{cur_ver}\"'" - rescue => ok_if_dir_already_existing - puts 'warning--dir already existing?' + ok_if_dir_already_existing.to_s + for suffix in [ '.tgz', '.zip'] + name = 'sensible-cinema-' + cur_ver + suffix + p 'copying to ilab' + sys "scp #{name} rdp@ilab1.cs.byu.edu:~/incoming" + p 'creating sf shell' + sys "ssh rdp@ilab1.cs.byu.edu 'ssh rogerdpack,sensible-cinema@shell.sourceforge.net create'" # needed for the next command to be able to work [weird] + p 'creating sf dir' + begin + sys "ssh rdp@ilab1.cs.byu.edu 'ssh rogerdpack,sensible-cinema@shell.sourceforge.net \"mkdir /home/frs/project/s/se/sensible-cinema/#{cur_ver}\"'" + rescue => ok_if_dir_already_existing + puts 'warning--dir already existing?' + ok_if_dir_already_existing.to_s + end + p 'copying into sf from ilab' + sys "ssh rdp@ilab1.cs.byu.edu 'scp ~/incoming/#{name} rogerdpack,sensible-cinema@frs.sourceforge.net:/home/frs/project/s/se/sensible-cinema/#{cur_ver}/#{name}'" end - p 'copying into sf from ilab' - sys "ssh rdp@ilab1.cs.byu.edu 'scp ~/incoming/#{name} rogerdpack,sensible-cinema@frs.sourceforge.net:/home/frs/project/s/se/sensible-cinema/#{cur_ver}/#{name}'" - p 'successfully deployed to sf only! ' + cur_ver + p 'successfully deployed to sf! ' + cur_ver end task 'gem_release' do FileUtils.rm_rf 'pkg' Rake::Task["build"].execute