Module: Hawk::Builder
- Defined in:
- lib/hawk/builder.rb
Defined Under Namespace
Modules: DSL
Instance Method Summary collapse
- #app_name ⇒ Object
- #app_version ⇒ Object
- #build_plist ⇒ Object
- #build_webpage ⇒ Object
- #bundle_identifier ⇒ Object
- #escaped_ipa_url ⇒ Object
- #ipa_file ⇒ Object
- #itms_url ⇒ Object
- #repo_version ⇒ Object
Instance Method Details
#app_name ⇒ Object
29 30 31 |
# File 'lib/hawk/builder.rb', line 29 def app_name info_plist_property('CFBundleDisplayName') end |
#app_version ⇒ Object
33 34 35 |
# File 'lib/hawk/builder.rb', line 33 def app_version info_plist_property('CFBundleVersion') end |
#build_plist ⇒ Object
65 66 67 |
# File 'lib/hawk/builder.rb', line 65 def build_plist ERB.new(File.read(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'manifest.plist.erb'))).result(binding) end |
#build_webpage ⇒ Object
77 78 79 |
# File 'lib/hawk/builder.rb', line 77 def build_webpage ERB.new(File.read(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'install.html.erb'))).result(binding) end |
#bundle_identifier ⇒ Object
37 38 39 |
# File 'lib/hawk/builder.rb', line 37 def bundle_identifier info_plist_property('CFBundleIdentifier') end |
#escaped_ipa_url ⇒ Object
73 74 75 |
# File 'lib/hawk/builder.rb', line 73 def escaped_ipa_url CGI.escapeHTML(ipa_url) end |
#ipa_file ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/hawk/builder.rb', line 45 def ipa_file if (!@ipa_file) output_dir = Dir.tmpdir product_name = project_property('PRODUCT_NAME') @ipa_file = File.join(output_dir, "#{product_name}.ipa") the_app_file = app_file # Do this before below so output happens in the right order print "Signing app..." output = `/usr/bin/xcrun -sdk iphoneos PackageApplication -v -s "#{@signing_identity || "iPhone Distribution"}" -o #{@ipa_file} #{the_app_file} 2>&1` if $?.to_i != 0 puts "error (text follows)" abort output end puts "done" end FileUtils.copy(@ipa_file, Dir.pwd) if @options[:preserve_ipa] @ipa_file end |
#itms_url ⇒ Object
69 70 71 |
# File 'lib/hawk/builder.rb', line 69 def itms_url "itms-services://?#{URI.encode_www_form(:action => "download-manifest", :url => plist_url)}" end |
#repo_version ⇒ Object
41 42 43 |
# File 'lib/hawk/builder.rb', line 41 def repo_version `git rev-parse --short HEAD`.chomp end |