Class: Fastlane::Actions::CleanCocoapodsCacheAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, author, deprecated_notes, details, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorsObject



55
56
57
# File 'fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb', line 55

def self.authors
  ["alexmx"]
end

.available_optionsObject



23
24
25
26
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
# File 'fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb', line 23

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :name,
                                 env_name: "FL_CLEAN_COCOAPODS_CACHE_DEVELOPMENT",
                                 description: "Pod name to be removed from cache",
                                 optional: true,
                                 verify_block: proc do |value|
                                   UI.user_error!("You must specify pod name which should be removed from cache") if value.to_s.empty?
                                 end),
    FastlaneCore::ConfigItem.new(key: :no_ansi,
                                 env_name: "FL_CLEAN_COCOAPODS_CACHE_NO_ANSI",
                                 description: "Show output without ANSI codes",
                                 type: Boolean,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :verbose,
                                 env_name: "FL_CLEAN_COCOAPODS_CACHE_VERBOSE",
                                 description: "Show more debugging information",
                                 type: Boolean,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :silent,
                                 env_name: "FL_CLEAN_COCOAPODS_CACHE_SILENT",
                                 description: "Show nothing",
                                 type: Boolean,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :allow_root,
                                 env_name: "FL_CLEAN_COCOAPODS_CACHE_ALLOW_ROOT",
                                 description: "Allows CocoaPods to run as root",
                                 type: Boolean,
                                 default_value: false)
  ]
end

.categoryObject



70
71
72
# File 'fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb', line 70

def self.category
  :building
end

.descriptionObject



19
20
21
# File 'fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb', line 19

def self.description
  'Remove the cache for pods'
end

.example_codeObject



63
64
65
66
67
68
# File 'fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb', line 63

def self.example_code
  [
    'clean_cocoapods_cache',
    'clean_cocoapods_cache(name: "CACHED_POD")'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



59
60
61
# File 'fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb', line 59

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
# File 'fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb', line 4

def self.run(params)
  Actions.verify_gem!('cocoapods')

  cmd = ['pod cache clean']

  cmd << params[:name].to_s if params[:name]
  cmd << '--no-ansi' if params[:no_ansi]
  cmd << '--verbose' if params[:verbose]
  cmd << '--silent' if params[:silent]
  cmd << '--allow-root' if params[:allow_root]
  cmd << '--all'

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