Class: Fastlane::Actions::ZipAction

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

Defined Under Namespace

Classes: Runner

Constant Summary

Constants inherited from Fastlane::Action

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

Documentation collapse

Class Method Summary collapse

Methods inherited from Fastlane::Action

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

Class Method Details

.authorsObject



175
176
177
# File 'fastlane/lib/fastlane/actions/zip.rb', line 175

def self.authors
  ["KrauseFx"]
end

.available_optionsObject



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'fastlane/lib/fastlane/actions/zip.rb', line 83

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :path,
                                 env_name: "FL_ZIP_PATH",
                                 description: "Path to the directory or file to be zipped",
                                 verify_block: proc do |value|
                                   path = File.expand_path(value)
                                   UI.user_error!("Couldn't find file/folder at path '#{path}'") unless File.exist?(path)
                                 end),
    FastlaneCore::ConfigItem.new(key: :output_path,
                                 env_name: "FL_ZIP_OUTPUT_NAME",
                                 description: "The name of the resulting zip file",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :verbose,
                                 env_name: "FL_ZIP_VERBOSE",
                                 description: "Enable verbose output of zipped file",
                                 default_value: true,
                                 type: Boolean,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :password,
                                 env_name: "FL_ZIP_PASSWORD",
                                 description: "Encrypt the contents of the zip archive using a password",
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :symlinks,
                                 env_name: "FL_ZIP_SYMLINKS",
                                 description: "Store symbolic links as such in the zip archive",
                                 optional: true,
                                 type: Boolean,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :include,
                                 env_name: "FL_ZIP_INCLUDE",
                                 description: "Array of paths or patterns to include",
                                 optional: true,
                                 type: Array,
                                 default_value: []),
    FastlaneCore::ConfigItem.new(key: :exclude,
                                 env_name: "FL_ZIP_EXCLUDE",
                                 description: "Array of paths or patterns to exclude",
                                 optional: true,
                                 type: Array,
                                 default_value: [])
  ]
end

.categoryObject



159
160
161
# File 'fastlane/lib/fastlane/actions/zip.rb', line 159

def self.category
  :misc
end

.descriptionObject



79
80
81
# File 'fastlane/lib/fastlane/actions/zip.rb', line 79

def self.description
  "Compress a file or folder to a zip"
end

.example_codeObject



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'fastlane/lib/fastlane/actions/zip.rb', line 127

def self.example_code
  [
    'zip',
    'zip(
      path: "MyApp.app",
      output_path: "Latest.app.zip"
    )',
    'zip(
      path: "MyApp.app",
      output_path: "Latest.app.zip",
      verbose: false
    )',
    'zip(
      path: "MyApp.app",
      output_path: "Latest.app.zip",
      verbose: false,
      symlinks: true
    )',
    'zip(
      path: "./",
      output_path: "Source Code.zip",
      exclude: [".git/*"]
    )',
    'zip(
      path: "./",
      output_path: "Swift Code.zip",
      include: ["**/*.swift"],
      exclude: ["Package.swift", "vendor/*", "Pods/*"]
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



179
180
181
# File 'fastlane/lib/fastlane/actions/zip.rb', line 179

def self.is_supported?(platform)
  true
end

.outputObject



163
164
165
# File 'fastlane/lib/fastlane/actions/zip.rb', line 163

def self.output
  []
end

.return_typeObject



171
172
173
# File 'fastlane/lib/fastlane/actions/zip.rb', line 171

def self.return_type
  :string
end

.return_valueObject



167
168
169
# File 'fastlane/lib/fastlane/actions/zip.rb', line 167

def self.return_value
  "The path to the output zip file"
end

.run(params) ⇒ Object



71
72
73
# File 'fastlane/lib/fastlane/actions/zip.rb', line 71

def self.run(params)
  Runner.new(params).run
end