Class: BetaBuilder::Tasks::Configuration
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- BetaBuilder::Tasks::Configuration
- Defined in:
- lib/beta_builder.rb
Instance Method Summary collapse
- #app_file_name ⇒ Object
- #archive_name ⇒ Object
- #build_arguments ⇒ Object
- #built_app_dsym_path ⇒ Object
- #built_app_path ⇒ Object
- #deploy_using(strategy_name, &block) ⇒ Object
- #derived_build_dir_from_build_output ⇒ Object
- #dist_path ⇒ Object
- #ipa_name ⇒ Object
- #ipa_path ⇒ Object
- #release_notes_text ⇒ Object
Instance Method Details
#app_file_name ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/beta_builder.rb', line 63 def app_file_name raise ArgumentError, "app_name or target must be set in the BetaBuilder configuration block" if app_name.nil? && target.nil? if app_name "#{app_name}.app" else "#{target}.app" end end |
#archive_name ⇒ Object
59 60 61 |
# File 'lib/beta_builder.rb', line 59 def archive_name app_name || target end |
#build_arguments ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/beta_builder.rb', line 44 def build_arguments args = "" if workspace_path raise "A scheme is required if building from a workspace" unless scheme args << "-workspace '#{workspace_path}' -scheme '#{scheme}' -configuration '#{configuration}'" else args = "-target '#{target}' -configuration '#{configuration}' -sdk iphoneos" args << " -project #{project_file_path}" if project_file_path end args << " -arch \"#{arch}\"" unless arch.nil? args end |
#built_app_dsym_path ⇒ Object
102 103 104 |
# File 'lib/beta_builder.rb', line 102 def built_app_dsym_path "#{built_app_path}.dSYM" end |
#built_app_path ⇒ Object
80 81 82 83 84 85 86 |
# File 'lib/beta_builder.rb', line 80 def built_app_path if build_dir == :derived "#{derived_build_dir_from_build_output}/#{configuration}-iphoneos/#{app_file_name}" else "#{build_dir}/#{configuration}-iphoneos/#{app_file_name}" end end |
#deploy_using(strategy_name, &block) ⇒ Object
114 115 116 117 118 119 120 121 |
# File 'lib/beta_builder.rb', line 114 def deploy_using(strategy_name, &block) if DeploymentStrategies.valid_strategy?(strategy_name.to_sym) self.deployment_strategy = DeploymentStrategies.build(strategy_name, self) self.deployment_strategy.configure(&block) else raise "Unknown deployment strategy '#{strategy_name}'." end end |
#derived_build_dir_from_build_output ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/beta_builder.rb', line 88 def derived_build_dir_from_build_output output = File.read("build.output") # yes, this is truly horrible, but unless somebody else can find a better way... found = output.split("\n").grep(/^Validate(.*)\/Xcode\/DerivedData\/(.*)-(.*)/).first if found && found =~ /Validate \"(.*)\"/ reference = $1 else raise "Cannot parse build_dir from build output." end derived_data_directory = reference.split("/Build/Products/").first "#{derived_data_directory}/Build/Products/" end |
#dist_path ⇒ Object
106 107 108 |
# File 'lib/beta_builder.rb', line 106 def dist_path File.join("pkg/dist") end |
#ipa_name ⇒ Object
72 73 74 75 76 77 78 |
# File 'lib/beta_builder.rb', line 72 def ipa_name if app_name "#{app_name}.ipa" else "#{target}.ipa" end end |
#ipa_path ⇒ Object
110 111 112 |
# File 'lib/beta_builder.rb', line 110 def ipa_path File.join(dist_path, ipa_name) end |
#release_notes_text ⇒ Object
39 40 41 42 |
# File 'lib/beta_builder.rb', line 39 def release_notes_text return release_notes.call if release_notes.is_a? Proc release_notes end |