Class: Fastlane::Actions::CarthageAction

Inherits:
Fastlane::Action show all
Defined in:
lib/fastlane/actions/carthage.rb

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, details, output, return_value, sh, step_text

Class Method Details

.authorsObject



93
94
95
# File 'lib/fastlane/actions/carthage.rb', line 93

def self.authors
  ["bassrock", "petester42", "jschmid", "JaviSoto"]
end

.available_optionsObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/fastlane/actions/carthage.rb', line 27

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :update,
                                 env_name: "FL_CARTHAGE_UPDATE",
                                 description: "Update the the project's dependencies",
                                 is_string: false,
                                 optional: true,
                                 default_value: false,
                                 verify_block: proc do |value|
                                   raise "Please pass a valid value for update. Use one of the following: true, false" unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end),

    FastlaneCore::ConfigItem.new(key: :use_ssh,
                                 env_name: "FL_CARTHAGE_USE_SSH",
                                 description: "Use SSH for downloading GitHub repositories",
                                 is_string: false,
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Please pass a valid value for use_ssh. Use one of the following: true, false" unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end),
    FastlaneCore::ConfigItem.new(key: :use_submodules,
                                 env_name: "FL_CARTHAGE_USE_SUBMODULES",
                                 description: "Add dependencies as Git submodules",
                                 is_string: false,
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Please pass a valid value for use_submodules. Use one of the following: true, false" unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end),
    FastlaneCore::ConfigItem.new(key: :use_binaries,
                                 env_name: "FL_CARTHAGE_USE_BINARIES",
                                 description: "Check out dependency repositories even when prebuilt frameworks exist",
                                 is_string: false,
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Please pass a valid value for use_binaries. Use one of the following: true, false" unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end),
    FastlaneCore::ConfigItem.new(key: :no_build,
                                 env_name: "FL_CARTHAGE_NO_BUILD",
                                 description: "When bootstrapping Carthage do not build",
                                 is_string: false,
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Please pass a valid value for no_build. Use one of the following: true, false" unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end),
    FastlaneCore::ConfigItem.new(key: :verbose,
                                 env_name: "FL_CARTHAGE_VERBOSE",
                                 description: "Print xcodebuild output inline",
                                 is_string: false,
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Please pass a valid value for verbose. Use one of the following: true, false" unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
                                 end),
    FastlaneCore::ConfigItem.new(key: :platform,
                                 env_name: "FL_CARTHAGE_PLATFORM",
                                 description: "Define which platform to build for",
                                 optional: true,
                                 verify_block: proc do |value|
                                   raise "Please pass a valid platform. Use one of the following: all, iOS, Mac, watchOS" unless ["all", "iOS", "Mac", "watchOS"].include? value
                                 end)
  ]
end

.descriptionObject



23
24
25
# File 'lib/fastlane/actions/carthage.rb', line 23

def self.description
  "Runs `carthage bootstrap` or `carthage update` for your project"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/fastlane/actions/carthage.rb', line 89

def self.is_supported?(platform)
  [:ios, :mac].include? platform
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/actions/carthage.rb', line 4

def self.run(params)
  cmd = ["carthage"]

  if params[:update]
    cmd << "update"
  else
    cmd << "bootstrap"
  end

  cmd << "--use-ssh" if params[:use_ssh]
  cmd << "--use-submodules" if params[:use_submodules]
  cmd << "--no-use-binaries" if params[:use_binaries] == false
  cmd << "--no-build" if params[:no_build] == true
  cmd << "--verbose" if params[:verbose] == true
  cmd << "--platform #{params[:platform]}" if params[:platform]

  Actions.sh(cmd.join(' '))
end