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
28 29 30 |
# File 'lib/hawk/builder.rb', line 28 def app_name info_plist_property('CFBundleDisplayName') end |
#app_version ⇒ Object
32 33 34 |
# File 'lib/hawk/builder.rb', line 32 def app_version info_plist_property('CFBundleVersion') end |
#build_plist ⇒ Object
63 64 65 |
# File 'lib/hawk/builder.rb', line 63 def build_plist ERB.new(File.read(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'manifest.plist.erb'))).result(binding) end |
#build_webpage ⇒ Object
75 76 77 |
# File 'lib/hawk/builder.rb', line 75 def build_webpage ERB.new(File.read(File.join(File.dirname(__FILE__), '..', '..', 'templates', 'install.html.erb'))).result(binding) end |
#bundle_identifier ⇒ Object
36 37 38 |
# File 'lib/hawk/builder.rb', line 36 def bundle_identifier info_plist_property('CFBundleIdentifier') end |
#escaped_ipa_url ⇒ Object
71 72 73 |
# File 'lib/hawk/builder.rb', line 71 def escaped_ipa_url CGI.escapeHTML(ipa_url) end |
#ipa_file ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/hawk/builder.rb', line 44 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 @ipa_file end |
#itms_url ⇒ Object
67 68 69 |
# File 'lib/hawk/builder.rb', line 67 def itms_url "itms-services://?#{URI.encode_www_form(:action => "download-manifest", :url => plist_url)}" end |
#repo_version ⇒ Object
40 41 42 |
# File 'lib/hawk/builder.rb', line 40 def repo_version `git rev-parse --short HEAD`.chomp end |