Class: Xcodeproj::XCScheme::ArchiveAction

Inherits:
AbstractSchemeAction show all
Defined in:
lib/xcodeproj/scheme/archive_action.rb

Overview

This class wraps the ArchiveAction node of a .xcscheme XML file

Instance Attribute Summary

Attributes inherited from XMLElementWrapper

#xml_element

Instance Method Summary collapse

Methods inherited from AbstractSchemeAction

#add_post_action, #add_pre_action, #build_configuration, #build_configuration=, #post_actions, #post_actions=, #pre_actions, #pre_actions=

Methods inherited from XMLElementWrapper

#to_s

Constructor Details

#initialize(node = nil) ⇒ ArchiveAction

Returns a new instance of ArchiveAction.

Parameters:

  • node (REXML::Element) (defaults to: nil)

    The 'ArchiveAction' XML node that this object will wrap. If nil, will create a default XML node to use.



12
13
14
15
16
17
# File 'lib/xcodeproj/scheme/archive_action.rb', line 12

def initialize(node = nil)
  create_xml_element_with_fallback(node, 'ArchiveAction') do
    self.build_configuration = 'Release'
    self.reveal_archive_in_organizer = true
  end
end

Instance Method Details

#custom_archive_nameString

Returns The custom name to give to the archive. If nil, the generated archive will have the same name as the one set in the associated target's Build Settings for the built product.

Returns:

  • (String)

    The custom name to give to the archive. If nil, the generated archive will have the same name as the one set in the associated target's Build Settings for the built product.



40
41
42
# File 'lib/xcodeproj/scheme/archive_action.rb', line 40

def custom_archive_name
  @xml_element.attributes['customArchiveName']
end

#custom_archive_name=(name) ⇒ Object

Parameters:

  • name (String)

    Set the custom name to use for the built archive If nil, the customization of the archive name will be removed and the generated archive will have the same name as the one set in the associated target's Build Settings for the build product.



50
51
52
53
54
55
56
# File 'lib/xcodeproj/scheme/archive_action.rb', line 50

def custom_archive_name=(name)
  if name
    @xml_element.attributes['customArchiveName'] = name
  else
    @xml_element.delete_attribute('customArchiveName')
  end
end

#reveal_archive_in_organizer=(flag) ⇒ Object

Parameters:

  • flag (Bool)

    Set whether the Archive will be revealed in Xcode's Organizer after it's done building.



31
32
33
# File 'lib/xcodeproj/scheme/archive_action.rb', line 31

def reveal_archive_in_organizer=(flag)
  @xml_element.attributes['revealArchiveInOrganizer'] = bool_to_string(flag)
end

#reveal_archive_in_organizer?Bool

Returns Whether the Archive will be revealed in Xcode's Organizer after it's done building.

Returns:

  • (Bool)

    Whether the Archive will be revealed in Xcode's Organizer after it's done building.



23
24
25
# File 'lib/xcodeproj/scheme/archive_action.rb', line 23

def reveal_archive_in_organizer?
  string_to_bool(@xml_element.attributes['revealArchiveInOrganizer'])
end