fastlane-plugin-clear_archived_data 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ea6d8afe79ed60b90859a61fddd311f4384f37a3153fd2f3aaa32b873cf2cda
4
- data.tar.gz: a69dc18c8e6d60dabde7ff5d29c94591b40cfa75816fee1d46e7f5a9b1f7ee74
3
+ metadata.gz: 6a85207ab46c8d294827ae7244d81e47d84f785bea2199d0daaf7013025730bb
4
+ data.tar.gz: 49833a9ef42175a266116a08206f55f8ae60593db64481f0ce6bad3a71995fb9
5
5
  SHA512:
6
- metadata.gz: 377aadca56f3671d3e160f16a5830126226cf8b6af46a9ea7a0b901a696069add4da72a991abb407b4ecf388d24e711af2911d5ea14af042f10deabb7a95f2a6
7
- data.tar.gz: a6f25cb81cb096e4ba1c98c28a899616d97f251e9e23d85bf3e9566f4c48e9f53ddc7c33a6bfccd95ffb51a54590bf9a718e1460333f19056eed3fccfff463e9
6
+ metadata.gz: 47da9f2f3be9974dca617fc57f505cac8e56a527dd28a7fe2b135261a18317a991f9e1a308dd495621ada8baa608d9c287e4430acf0e25ecd297360b8dec409c
7
+ data.tar.gz: 5c45d57790981227f237e23305c2844ae97580872350924205adc0a39f660ee2e938f5b222ec43f45fc5725f2e1aba8b9c7e10b47d12f1aee28dc3c9f1971c1b
data/README.md CHANGED
@@ -12,7 +12,7 @@ fastlane add_plugin clear_archived_data
12
12
 
13
13
  ## About clear_archived_data
14
14
 
15
- Clears xcode archive folder
15
+ Deletes the archive file located at SharedValues::XCODEBUILD_ARCHIVE.
16
16
 
17
17
  **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
18
 
@@ -1,89 +1,16 @@
1
- require 'fileutils'
1
+ require 'fastlane/plugin/clear_archived_data/version'
2
2
 
3
3
  module Fastlane
4
- module Actions
5
- module SharedValues
6
- CLEAR_ARCHIVED_DATA_CUSTOM_VALUE = :CLEAR_ARCHIVED_DATA_CUSTOM_VALUE
7
- end
8
-
9
- class ClearArchivedDataAction < Action
10
- def self.run(params)
11
- # fastlane will take care of reading in the parameter and fetching the environment variable:
12
- path = File.expand_path("~/Library/Developer/Xcode/Archives")
13
- UI.message("Archived Data path located at: #{path}")
14
- FileUtils.rm_rf(path) if File.directory?(path)
15
- UI.success("Successfully cleared Archived Data ♻️")
16
-
17
- # sh "shellcommand ./path"
18
-
19
- # Actions.lane_context[SharedValues::CLEAR_ARCHIVED_DATA_CUSTOM_VALUE] = "my_val"
20
- end
21
-
22
- #####################################################
23
- # @!group Documentation
24
- #####################################################
25
-
26
- def self.description
27
- "Deletes the Xcode Archived Data"
28
- end
29
-
30
- def self.details
31
- # Optional:
32
- # this is your chance to provide a more detailed description of this action
33
- "Deletes the Archived Data from path set on Xcode or a supplied path"
34
- end
35
-
36
- def self.available_options
37
- # Define all options your action supports.
38
-
39
- # Below a few examples
40
- [
41
- FastlaneCore::ConfigItem.new(key: :api_token,
42
- env_name: "FL_CLEAR_ARCHIVED_DATA_API_TOKEN", # The name of the environment variable
43
- description: "API Token for ClearArchivedDataAction", # a short description of this parameter
44
- verify_block: proc do |value|
45
- UI.user_error!("No API token for ClearArchivedDataAction given, pass using `api_token: 'token'`") unless (value and not value.empty?)
46
- # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
47
- end),
48
- FastlaneCore::ConfigItem.new(key: :development,
49
- env_name: "FL_CLEAR_ARCHIVED_DATA_DEVELOPMENT",
50
- description: "Create a development certificate instead of a distribution one",
51
- is_string: false, # true: verifies the input is a string, false: every kind of value
52
- default_value: false) # the default value if the user didn't provide one
53
- ]
54
- end
55
-
56
- def self.output
57
- # Define the shared values you are going to provide
58
- # Example
59
- [
60
- ['CLEAR_ARCHIVED_DATA_CUSTOM_VALUE', 'A description of what this value contains']
61
- ]
62
- end
63
-
64
- def self.return_value
65
- # If your method provides a return value, you can describe here what it does
66
- end
67
-
68
- def self.authors
69
- # So no one will ever forget your contribution to fastlane :) You are awesome btw!
70
- ["Onur Yıldırım"]
71
- end
72
-
73
- def self.is_supported?(platform)
74
- [
75
- 'clear_derived_data'
76
- ]
77
- #
78
- # true
79
- #
80
- # platform == :ios
81
- #
82
- # [:ios, :mac].include?(platform)
83
- #
84
-
85
- platform == :ios
86
- end
4
+ module ClearArchivedData
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
87
8
  end
88
9
  end
89
10
  end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::ClearArchivedData.all_classes.each do |current|
15
+ require current
16
+ end
@@ -1,3 +1,4 @@
1
+ require 'fileutils'
1
2
  require 'fastlane/action'
2
3
  require_relative '../helper/clear_archived_data_helper'
3
4
 
@@ -5,11 +6,18 @@ module Fastlane
5
6
  module Actions
6
7
  class ClearArchivedDataAction < Action
7
8
  def self.run(params)
8
- UI.message("The clear_archived_data plugin is working!")
9
+ path = Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE]
10
+ if File.directory?(path)
11
+ UI.message("Archive file found at path: #{path}")
12
+ FileUtils.rm_rf(path)
13
+ UI.success("Successfully deleted archive file. ♻️")
14
+ else
15
+ UI.message("Unable to locate archive file. Skipping...")
16
+ end
9
17
  end
10
18
 
11
19
  def self.description
12
- "Clears xcode archive folder"
20
+ "Deletes the archive file located at SharedValues::XCODEBUILD_ARCHIVE."
13
21
  end
14
22
 
15
23
  def self.authors
@@ -17,30 +25,19 @@ module Fastlane
17
25
  end
18
26
 
19
27
  def self.return_value
20
- # If your method provides a return value, you can describe here what it does
28
+ "No return value"
21
29
  end
22
30
 
23
31
  def self.details
24
- # Optional:
25
- "Deletes the Archived data from path set on Xcode"
32
+ "Deletes the archive file from path set on Xcode."
26
33
  end
27
34
 
28
35
  def self.available_options
29
- [
30
- # FastlaneCore::ConfigItem.new(key: :your_option,
31
- # env_name: "CLEAR_ARCHIVED_DATA_YOUR_OPTION",
32
- # description: "A description of your option",
33
- # optional: false,
34
- # type: String)
35
- ]
36
+ []
36
37
  end
37
38
 
38
39
  def self.is_supported?(platform)
39
- # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
40
- # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
41
- #
42
- # [:ios, :mac, :android].include?(platform)
43
- true
40
+ [:ios, :mac].include?(platform)
44
41
  end
45
42
  end
46
43
  end
@@ -1,8 +1,4 @@
1
- require 'fastlane_core/ui/ui'
2
-
3
1
  module Fastlane
4
- UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
5
-
6
2
  module Helper
7
3
  class ClearArchivedDataHelper
8
4
  # class methods that you define here become available in your action
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module ClearArchivedData
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-clear_archived_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onur Yıldırım
@@ -148,7 +148,7 @@ files:
148
148
  - lib/fastlane/plugin/clear_archived_data/actions/clear_archived_data_action.rb
149
149
  - lib/fastlane/plugin/clear_archived_data/helper/clear_archived_data_helper.rb
150
150
  - lib/fastlane/plugin/clear_archived_data/version.rb
151
- homepage: https://github.com/yildirmonur/fastlane-plugin-clear_archived_data
151
+ homepage: https://github.com/yildirmonur/clear_archived_data
152
152
  licenses:
153
153
  - MIT
154
154
  metadata: {}
@@ -170,5 +170,5 @@ requirements: []
170
170
  rubygems_version: 3.0.3
171
171
  signing_key:
172
172
  specification_version: 4
173
- summary: Clears xcode archive folder
173
+ summary: Deletes the archive file located at SharedValues::XCODEBUILD_ARCHIVE.
174
174
  test_files: []