danger-xcprofiler 0.4.0 → 0.5.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 +4 -4
- data/.github/workflows/ruby.yml +37 -0
- data/.rubocop.yml +9 -0
- data/.ruby-version +1 -0
- data/README.md +7 -2
- data/danger-xcprofiler.gemspec +7 -10
- data/lib/xcprofiler/gem_version.rb +1 -1
- data/lib/xcprofiler/plugin.rb +8 -2
- data/spec/spec_helper.rb +2 -5
- metadata +17 -32
- data/.coveralls.yml +0 -1
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffb92acc3f723fffe36d95a54d3e39d743c2ac24425e7cf4468992535c353ede
|
4
|
+
data.tar.gz: 236ecd6d8f3af89039d22a608b8ce261669e6cfd5dc7f27a0387ef6ce17d1f93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c77695577fb7b5a8c527bada81931274cd86da2d213ce350078ea2b64935711b95e0d2039a0e2bbce5efc087b39e4b998ef991ef7da5de559b812c9bf72f2c3e
|
7
|
+
data.tar.gz: 99efe20d66d9ee8a2529f00ef436afe8dd7514b8456c6bd25b20fa9467d263408558c0020a7896402900ae07568b046597cc5c06acb3ae3b9a2f07b0b68c637b
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby
|
27
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
28
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
29
|
+
# uses: ruby/setup-ruby@v1
|
30
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
33
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
+
- name: Run tests
|
35
|
+
run: |
|
36
|
+
bundle exec rake
|
37
|
+
bundle exec rubocop
|
data/.rubocop.yml
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
|
1
4
|
Metrics/ModuleLength:
|
2
5
|
Max: 120
|
3
6
|
|
@@ -22,3 +25,9 @@ Lint/DuplicateMethods:
|
|
22
25
|
|
23
26
|
Style/DoubleNegation:
|
24
27
|
Enabled: false
|
28
|
+
|
29
|
+
Style/FrozenStringLiteralComment:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Metrics/CyclomaticComplexity:
|
33
|
+
Max: 10
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0.2
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# danger-xcprofiler
|
2
|
-
|
3
|
-
[](https://coveralls.io/github/giginet/danger-xcprofiler?branch=master)
|
2
|
+

|
4
3
|
[](https://badge.fury.io/rb/danger-xcprofiler)
|
5
4
|
|
6
5
|
[danger](https://github.com/danger/danger) plugin for asserting Swift compilation time.
|
@@ -25,6 +24,12 @@ Just add this line to your Dangerfile:
|
|
25
24
|
xcprofiler.report 'MyApp'
|
26
25
|
```
|
27
26
|
|
27
|
+
Or specify an xcactivitylog path
|
28
|
+
```ruby
|
29
|
+
logDir = Dir[File.join('DerivedData/Logs/Build/', '*.xcactivitylog')].first
|
30
|
+
xcprofiler.report nil, nil, logDir
|
31
|
+
```
|
32
|
+
|
28
33
|
If compilation times of each methods are exceeded the thresholds, `danger` adds inline comment to your PR.
|
29
34
|
|
30
35
|
Default thresholds is 50ms for warning, 100ms for failure.
|
data/danger-xcprofiler.gemspec
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
4
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require 'xcprofiler/gem_version
|
3
|
+
require 'xcprofiler/gem_version'
|
6
4
|
|
7
5
|
Gem::Specification.new do |spec|
|
8
6
|
spec.name = 'danger-xcprofiler'
|
@@ -19,18 +17,17 @@ Gem::Specification.new do |spec|
|
|
19
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
18
|
spec.require_paths = ['lib']
|
21
19
|
|
20
|
+
spec.required_ruby_version = '>= 2.6'
|
21
|
+
|
22
22
|
spec.add_dependency 'xcprofiler'
|
23
23
|
spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
|
24
24
|
|
25
25
|
# General ruby development
|
26
|
-
spec.add_development_dependency 'bundler'
|
27
|
-
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'rake'
|
28
28
|
|
29
29
|
# Testing support
|
30
|
-
spec.add_development_dependency 'rspec'
|
31
|
-
|
32
|
-
# Calculating code coverage
|
33
|
-
spec.add_development_dependency 'coveralls'
|
30
|
+
spec.add_development_dependency 'rspec'
|
34
31
|
|
35
32
|
# Linting code and docs
|
36
33
|
spec.add_development_dependency 'rubocop'
|
data/lib/xcprofiler/plugin.rb
CHANGED
@@ -48,9 +48,15 @@ module Danger
|
|
48
48
|
# Search the latest .xcactivitylog by the passing product_name and profile compilation time
|
49
49
|
# @param [String] product_name Product name for the target project.
|
50
50
|
# @param [String] derived_data_path Path to the directory containing the DerivedData.
|
51
|
+
# @param [String] log_path Path to the xcactivitylog to process.
|
51
52
|
# @return [void]
|
52
|
-
def report(product_name, derived_data_path = nil)
|
53
|
-
profiler =
|
53
|
+
def report(product_name, derived_data_path = nil, log_path = nil)
|
54
|
+
profiler = if log_path&.end_with?('.xcactivitylog')
|
55
|
+
Xcprofiler::Profiler.by_path(log_path)
|
56
|
+
else
|
57
|
+
Xcprofiler::Profiler.by_product_name(product_name, derived_data_path)
|
58
|
+
end
|
59
|
+
|
54
60
|
profiler.reporters = [
|
55
61
|
DangerReporter.new(@dangerfile, thresholds, inline_mode, working_dir, ignored_files)
|
56
62
|
]
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,7 @@
|
|
1
|
-
require 'coveralls'
|
2
|
-
Coveralls.wear!
|
3
|
-
|
4
1
|
require 'pathname'
|
5
2
|
ROOT = Pathname.new(File.expand_path('..', __dir__))
|
6
|
-
$LOAD_PATH.unshift(
|
7
|
-
$LOAD_PATH.unshift(
|
3
|
+
$LOAD_PATH.unshift("#{ROOT}lib".to_s)
|
4
|
+
$LOAD_PATH.unshift("#{ROOT}spec".to_s)
|
8
5
|
|
9
6
|
require 'bundler/setup'
|
10
7
|
require 'pry'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-xcprofiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- giginet
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcprofiler
|
@@ -42,46 +42,32 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.4'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.4'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: coveralls
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
@@ -185,10 +171,10 @@ executables: []
|
|
185
171
|
extensions: []
|
186
172
|
extra_rdoc_files: []
|
187
173
|
files:
|
188
|
-
- ".
|
174
|
+
- ".github/workflows/ruby.yml"
|
189
175
|
- ".gitignore"
|
190
176
|
- ".rubocop.yml"
|
191
|
-
- ".
|
177
|
+
- ".ruby-version"
|
192
178
|
- Gemfile
|
193
179
|
- Guardfile
|
194
180
|
- LICENSE.txt
|
@@ -207,7 +193,7 @@ homepage: https://github.com/giginet/danger-xcprofiler
|
|
207
193
|
licenses:
|
208
194
|
- MIT
|
209
195
|
metadata: {}
|
210
|
-
post_install_message:
|
196
|
+
post_install_message:
|
211
197
|
rdoc_options: []
|
212
198
|
require_paths:
|
213
199
|
- lib
|
@@ -215,16 +201,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
201
|
requirements:
|
216
202
|
- - ">="
|
217
203
|
- !ruby/object:Gem::Version
|
218
|
-
version: '
|
204
|
+
version: '2.6'
|
219
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
206
|
requirements:
|
221
207
|
- - ">="
|
222
208
|
- !ruby/object:Gem::Version
|
223
209
|
version: '0'
|
224
210
|
requirements: []
|
225
|
-
|
226
|
-
|
227
|
-
signing_key:
|
211
|
+
rubygems_version: 3.2.22
|
212
|
+
signing_key:
|
228
213
|
specification_version: 4
|
229
214
|
summary: danger plugin for asserting Swift compilation time.
|
230
215
|
test_files:
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|