SHARE
TWEET

Untitled

a guest Jan 24th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. desc "osx", "create distribution package for Mac OS X"
  2.     method_option :dmg, :type => :boolean, :desc => "Create a DMG container instead of a zip file"
  3.     def osx
  4.       set_instance_variables
  5.  
  6.       # clean staging folder
  7.       clean
  8.  
  9.       osx_copy_to_staging(@product)
  10.  
  11.       # get version info directly from JSON in staging folder in case this was build off a different version
  12.       version_filename = File.join(STAGING_FOLDER, @product, 'version.txt')
  13.       version = read_version_string(version_filename)
  14.       label = options[:label]
  15.       label = read_version_label(@product, version_filename) unless label
  16.       label = ".#{label}" if label
  17.  
  18.       if options[:dmg]
  19.         # create the dmg file
  20.         source = File.join(STAGING_FOLDER, @product, "#{@product}.app".capitalize)
  21.         destination = "#{PKG_FOLDER}/#{@product}.#{version}.osx#{label}.dmg"
  22.         remove_file(destination)
  23.         run("hdiutil create #{destination} -volname #{@product} -size 200m -fs HFS+ -srcfolder #{source}")
  24.       else
  25.         source = File.join(STAGING_FOLDER, @product)
  26.         destination = "#{PKG_FOLDER}/#{@product}.#{version}.osx#{label}.zip"
  27.         remove_file(destination)
  28.         run "7za a -mx9 #{destination} #{source}"
  29.       end
  30.     end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top