Class: AppSendr::Command::Build

Inherits:
Base
  • Object
show all
Defined in:
lib/appsendr/commands/build.rb

Direct Known Subclasses

Collaborators, Deploy, Ipa

Instance Attribute Summary collapse

Attributes inherited from Base

#args, #autodetected_app

Instance Method Summary collapse

Methods inherited from Base

#appsendr, #ask, #confirm, #extract_app, #extract_option, #format_date, #initialize, #option_exists?

Methods included from Helpers

#credentials_file, #credentials_setup?, #display, #error, #has_project_droppr?, #home_directory, #in_project_dir?, #is_file_to_large?, #message, #project_appsendr, #project_appsendr_app, #read_app, #read_app_id, #require_in_project_and_no_droppr, #require_project, #require_project_dir, #require_project_droppr, #running_on_a_mac?, #running_on_windows?, #size_of_file

Constructor Details

This class inherits a constructor from AppSendr::Command::Base

Instance Attribute Details

#app_dirObject

Returns the value of attribute app_dir.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def app_dir
  @app_dir
end

#app_name=(value) ⇒ Object

Sets the attribute app_name

Parameters:

  • value

    the value to set the attribute app_name to.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def app_name=(value)
  @app_name = value
end

#app_pathObject

Returns the value of attribute app_path.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def app_path
  @app_path
end

#configurationObject

Returns the value of attribute configuration.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def configuration
  @configuration
end

#ipa_pathObject

Returns the value of attribute ipa_path.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def ipa_path
  @ipa_path
end

#project_info=(value) ⇒ Object

Sets the attribute project_info

Parameters:

  • value

    the value to set the attribute project_info to.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def project_info=(value)
  @project_info = value
end

#provisioning_nameObject

Returns the value of attribute provisioning_name.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def provisioning_name
  @provisioning_name
end

#provisioning_pathObject

Returns the value of attribute provisioning_path.



7
8
9
# File 'lib/appsendr/commands/build.rb', line 7

def provisioning_path
  @provisioning_path
end

Instance Method Details

#cleanObject



45
46
47
48
49
50
51
52
53
# File 'lib/appsendr/commands/build.rb', line 45

def clean
      require_project_dir("clean")
      require_project_droppr
      config = args.join(" ").strip              
      if !config.empty?
          config = "-configuration #{config} "
      end
      %x[xcodebuild #{config} clean]
end

#indexObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/appsendr/commands/build.rb', line 10

def index
 notify = option_exists?('--notify', false)
    is_public = option_exists?('--public', false)
    
    if require_project(1,"build","your active configuration name")
        @configuration = load_configuration
        message "Building Xcode project with configuration #{@configuration}"    
        compile(@configuration)   
        
        
          @app_dir = path_to_app_dir
          @app_path = @app_dir+"/#{app_name}"
          if @app_name
              @notes = ask_for_notes
              message "Building IPA File"    

              @ipa_path = build_ipa_with_app_at_path                  
              info = app_info              
              bundle_identifier ||= info['CFBundleIdentifier']
              icon_path = icon_path(info)
              if is_file_to_large?(@ipa_path)
                  upload_large_ipa(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
              else
                  message "Uploading IPA"
                  appsendr.upload(read_app_id,@ipa_path, profile_path,is_public,notify,@notes,bundle_identifier,icon_path)
                  message "App deployed"
              end
              FileUtils.rm_rf @ipa_path
          else
              error "No .app file was built for the configuration \"#{@configuration}\"."
          end
    end
end