Module: Gym

Defined in:
gym/lib/gym/xcode.rb,
gym/lib/gym/module.rb,
gym/lib/gym/runner.rb,
gym/lib/gym/manager.rb,
gym/lib/gym/options.rb,
gym/lib/gym/detect_values.rb,
gym/lib/gym/error_handler.rb,
gym/lib/gym/commands_generator.rb,
gym/lib/gym/code_signing_mapping.rb,
gym/lib/gym/generators/build_command_generator.rb,
gym/lib/gym/generators/package_command_generator.rb,
gym/lib/gym/xcodebuild_fixes/generic_archive_fix.rb,
gym/lib/gym/generators/package_command_generator_xcode7.rb

Defined Under Namespace

Classes: BuildCommandGenerator, CodeSigningMapping, CommandsGenerator, DetectValues, ErrorHandler, Manager, Options, PackageCommandGenerator, PackageCommandGeneratorXcode7, Runner, Xcode, XcodebuildFixes

Constant Summary collapse

Helper =

you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore

FastlaneCore::Helper
UI =
FastlaneCore::UI
Boolean =
Fastlane::Boolean
ROOT =
Pathname.new(File.expand_path('../../..', __FILE__))
DESCRIPTION =
"Building your iOS apps has never been easier"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cacheObject

Returns the value of attribute cache.



11
12
13
# File 'gym/lib/gym/module.rb', line 11

def cache
  @cache
end

.configObject

Returns the value of attribute config.



7
8
9
# File 'gym/lib/gym/module.rb', line 7

def config
  @config
end

.projectObject

Returns the value of attribute project.



9
10
11
# File 'gym/lib/gym/module.rb', line 9

def project
  @project
end

Class Method Details

.building_for_ios?Boolean

Returns:



36
37
38
39
40
41
42
43
44
45
46
47
# File 'gym/lib/gym/module.rb', line 36

def building_for_ios?
  if Gym.project.mac?
    # Can be building for iOS if mac project and catalyst or multiplatform and set to iOS
    return building_mac_catalyst_for_ios? || building_multiplatform_for_ios?
  else
    # Can be iOS project and build for mac if catalyst
    return false if building_mac_catalyst_for_mac?

    # Can be iOS project if iOS, tvOS, watchOS, or visionOS
    return Gym.project.ios? || Gym.project.tvos? || Gym.project.watchos? || Gym.project.visionos?
  end
end

.building_for_ipa?Boolean

Returns:



28
29
30
# File 'gym/lib/gym/module.rb', line 28

def building_for_ipa?
  return !building_for_pkg?
end

.building_for_mac?Boolean

Returns:



49
50
51
52
53
54
55
56
# File 'gym/lib/gym/module.rb', line 49

def building_for_mac?
  if Gym.project.supports_mac_catalyst?
    # Can be a mac project and not build mac if catalyst
    return building_mac_catalyst_for_mac?
  else
    return (!Gym.project.multiplatform? && Gym.project.mac?) || building_multiplatform_for_mac?
  end
end

.building_for_pkg?Boolean

Returns:



32
33
34
# File 'gym/lib/gym/module.rb', line 32

def building_for_pkg?
  return building_for_mac?
end

.building_mac_catalyst_for_ios?Boolean

Returns:



58
59
60
# File 'gym/lib/gym/module.rb', line 58

def building_mac_catalyst_for_ios?
  Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "ios"
end

.building_mac_catalyst_for_mac?Boolean

Returns:



62
63
64
# File 'gym/lib/gym/module.rb', line 62

def building_mac_catalyst_for_mac?
  Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "macos"
end

.building_multiplatform_for_ios?Boolean

Returns:



66
67
68
# File 'gym/lib/gym/module.rb', line 66

def building_multiplatform_for_ios?
  Gym.project.multiplatform? && Gym.project.ios? && (Gym.config[:sdk] == "iphoneos" || Gym.config[:sdk] == "iphonesimulator")
end

.building_multiplatform_for_mac?Boolean

Returns:



70
71
72
# File 'gym/lib/gym/module.rb', line 70

def building_multiplatform_for_mac?
  Gym.project.multiplatform? && Gym.project.mac? && Gym.config[:sdk] == "macosx"
end

.export_destination_upload?Boolean

Returns:



74
75
76
77
78
79
80
# File 'gym/lib/gym/module.rb', line 74

def export_destination_upload?
  config_path = Gym.cache[:config_path]
  return false if config_path.nil?

  result = CFPropertyList.native_types(CFPropertyList::List.new(file: config_path).value)
  return result["destination"] == "upload"
end

.gymfile_nameObject



19
20
21
# File 'gym/lib/gym/module.rb', line 19

def gymfile_name
  "Gymfile"
end

.init_libsObject



23
24
25
26
# File 'gym/lib/gym/module.rb', line 23

def init_libs
  # Import all the fixes
  require 'gym/xcodebuild_fixes/generic_archive_fix'
end