fastlane-plugin-ios_dependency_parser 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f94201999c4319e1cdc28d59f21414f201d52fc
4
+ data.tar.gz: f17dc19697e204e7a8d2c6fd6951e909a25a4f9d
5
+ SHA512:
6
+ metadata.gz: 445ef9bcc5b1a7a23c23d541c9397849663ffd874deb73f1ac5aa0a27f52c03a1771c438cb36221370dfb113efee8bee9aadc0c714c2af846ca1e147d9655fc3
7
+ data.tar.gz: bfb63f05edfd4d72f6fe494734cd20b232691f3b9144c28899481ce6d8484f226427dd10080b0f47fb3c0aaa8684e243160d93145871faa23f66bda3fd1822e8
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Daniel Kochavi <>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,69 @@
1
+ # ios_dependency_parser plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ios_dependency_parser)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-ios_dependency_parser`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin ios_dependency_parser
11
+ ```
12
+
13
+ ## About ios_dependency_parser
14
+
15
+ This plugin analyzes a [Cocoapods](https://cocoapods.org/) project dependencies by running `pod outdated` and parsing the results into an array of `Pods` available further on in the script via `lane_context[SharedValues::POD_ANALYZER_RESULTS]`.
16
+
17
+ [`Pod`](lib/fastlane/plugin/ios_dependency_parser/helper/pod.rb) object structure:
18
+ ```javascript
19
+ {
20
+ pod_name: 'Alamofire',
21
+ current_version: '4.8.2',
22
+ update_version: '4.9.0',
23
+ latest: '5.0.0-rc.2'
24
+ }
25
+ ```
26
+
27
+ You could use it, for example, to alert you when a dependency used in the project has changed its major version number (e.g. using [versionomy](https://github.com/dazuma/versionomy)).
28
+
29
+ ## Example
30
+
31
+ In this example we'll assume running `pod outdated` returns the following:
32
+ ```
33
+ The following pod updates are available:
34
+ - Alamofire 4.8.2 -> 4.9.0 (latest version 5.0.0-rc.2)
35
+ - Crashlytics 3.13.1 -> 3.13.1 (latest version 3.14.0)
36
+ - GoogleMaps 3.2.0 -> 3.2.0 (latest version 3.4.0)
37
+ - RxSwift 4.5.0 -> 4.5.0 (latest version 5.0.0)
38
+ ```
39
+
40
+
41
+
42
+ ## Run tests for this plugin
43
+
44
+ To run both the tests, and code style validation, run
45
+
46
+ ```
47
+ rake
48
+ ```
49
+
50
+ To automatically fix many of the styling issues, use
51
+ ```
52
+ rubocop -a
53
+ ```
54
+
55
+ ## Issues and Feedback
56
+
57
+ For any other issues and feedback about this plugin, please submit it to this repository.
58
+
59
+ ## Troubleshooting
60
+
61
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
62
+
63
+ ## Using _fastlane_ Plugins
64
+
65
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
66
+
67
+ ## About _fastlane_
68
+
69
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/ios_dependency_parser/version'
2
+
3
+ module Fastlane
4
+ module IosDependencyParser
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__))]
8
+ end
9
+ end
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::IosDependencyParser.all_classes.each do |current|
15
+ require current
16
+ end
@@ -0,0 +1,65 @@
1
+ # require 'versionomy'
2
+ require 'fastlane/action'
3
+ require_relative '../helper/ios_dependency_parser_helper'
4
+ require_relative '../helper/pod'
5
+
6
+ module Fastlane
7
+ module Actions
8
+ module SharedValues
9
+ POD_ANALYZER_RESULTS = :POD_ANALYZER_RESULTS
10
+ end
11
+ class ParsePodDependenciesAction < Action
12
+ def self.run(params)
13
+ if !File.exists?("Podfile")
14
+ UI.user_error!("Couldn't find Podfile in active path")
15
+ else
16
+ executor = FastlaneCore::CommandExecutor
17
+ UI.message("Collecting data about your pods, this may take a while... (running 'pod outdated')")
18
+ pod_outdated_results = executor.execute(command: "pod outdated",
19
+ print_all: false,
20
+ print_command: false)
21
+
22
+ pod_results = []
23
+ pod_version_regex = '- (?<pod_name>\S*) (?<current_version>\S*) -> (?<update_version>\S*) \(latest version (?<latest>\S*)\)'
24
+ pod_outdated_results.each_line do |line|
25
+ line_match = line.match(pod_version_regex)
26
+ if line_match && line_match.captures
27
+ pod_name = line_match.captures[0]
28
+ current_version = line_match.captures[1]
29
+ update_version = line_match.captures[2]
30
+ latest = line_match.captures[3]
31
+ pod = Pod.new(pod_name,current_version,update_version, latest)
32
+ pod_results.push(pod)
33
+ end
34
+ end
35
+
36
+ Actions.lane_context[SharedValues::POD_ANALYZER_RESULTS] = pod_results if pod_results
37
+ end
38
+ end
39
+
40
+ def self.description
41
+ "Analyzes 'pod outdated' results and structures it for further usage."
42
+ end
43
+
44
+ def self.authors
45
+ ["kochavi-daniel"]
46
+ end
47
+
48
+ def self.return_value
49
+
50
+ end
51
+
52
+ def self.details
53
+ "This plugin will run 'pod outdated' and will parse its results into an array of Pod(s) which could later be used in your script"
54
+ end
55
+
56
+ def self.available_options
57
+ []
58
+ end
59
+
60
+ def self.is_supported?(platform)
61
+ platform == :ios
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,11 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
5
+
6
+ module Helper
7
+ class IosDependencyParserHelper
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,19 @@
1
+ class Pod
2
+ COLORS_REGEXP_PATTERN = /\e\[(\d+)m/
3
+
4
+ def initialize(name, current, update, latest)
5
+ @pod_name = decolorize(name)
6
+ @current_version = decolorize(current)
7
+ @update_version = decolorize(update)
8
+ @latest = decolorize(latest)
9
+ end
10
+
11
+ def decolorize(str)
12
+ return str.gsub(COLORS_REGEXP_PATTERN,'')
13
+ end
14
+
15
+ attr_reader :pod_name
16
+ attr_reader :current_version
17
+ attr_reader :update_version
18
+ attr_reader :latest
19
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module IosDependencyParser
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-ios_dependency_parser
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - kochavi-daniel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-09-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec_junit_formatter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.49.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.49.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-require_tools
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: fastlane
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: 2.107.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: 2.107.0
139
+ description:
140
+ email: ''
141
+ executables: []
142
+ extensions: []
143
+ extra_rdoc_files: []
144
+ files:
145
+ - LICENSE
146
+ - README.md
147
+ - lib/fastlane/plugin/ios_dependency_parser.rb
148
+ - lib/fastlane/plugin/ios_dependency_parser/actions/ios_dependency_parser_action.rb
149
+ - lib/fastlane/plugin/ios_dependency_parser/helper/ios_dependency_parser_helper.rb
150
+ - lib/fastlane/plugin/ios_dependency_parser/helper/pod.rb
151
+ - lib/fastlane/plugin/ios_dependency_parser/version.rb
152
+ homepage: https://github.com/kochavi-daniel/fastlane-plugin-ios_dependency_parser
153
+ licenses:
154
+ - MIT
155
+ metadata: {}
156
+ post_install_message:
157
+ rdoc_options: []
158
+ require_paths:
159
+ - lib
160
+ required_ruby_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ requirements: []
171
+ rubyforge_project:
172
+ rubygems_version: 2.6.8
173
+ signing_key:
174
+ specification_version: 4
175
+ summary: Analyzes results of 'pod outdated' in a structured manner
176
+ test_files: []