xcprofiler 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 993adba543dd2012e33266d5cf358d89564e79f2
4
- data.tar.gz: 647e8751187aa7b96351fe9dd30c636359352edd
3
+ metadata.gz: 167469e1e9d334e5ffd877fb3b9668e1081d3238
4
+ data.tar.gz: fa51398662b069680afe18effa5c948dd04b0552
5
5
  SHA512:
6
- metadata.gz: f8d00f6b085ff30ba71894571287f8c7a92af9bb05a49fa0794ad033850b9233b7fa9e7e810041c7c9cb3dcc4cd2007560481ba4675f10f6a01c522fc430f3b7
7
- data.tar.gz: d39877c5f6d9b45ec99fd30f563dca830dcee227624947e05750071562f9fee32e64b6ce286f747c3eccd75cdf9657a4e854125f68060c85536da1a2c71fd6af
6
+ metadata.gz: 15dbea15d0d88ac47c876ca2ce77a0cb14b4b3640bea9089bfce5225f98f0a65ea863a522ca8abf82c8bcf8f683a1bf023c903d397fb1875b0a0c5dac574b524
7
+ data.tar.gz: d15a334bdf695d97de866f9137ad77a67fb0cc87ea3a04d6273eac8854f43541e5c8f4d7979f31bda36e4435c1eb780390b2d343d976947dcea87c0e996345f3
data/.travis.yml CHANGED
@@ -3,15 +3,9 @@ cache: bundler
3
3
  script:
4
4
  - "bundle exec rspec spec"
5
5
  rvm:
6
- # OS X 10.9.5-10.10.0 (2.0.0-p481)
7
- - 2.0.0-p481
8
- # OS X 10.9.3-10.9.4
9
- - 2.0.0-p451
10
- - 2.3.1
6
+ - 2.3.5
7
+ - 2.4.2
11
8
  matrix:
12
9
  include:
13
- - rvm: system
14
- osx_image: xcode8.1
15
- language: objective-c
16
- before_install: sudo gem install bundler
17
- - rvm: 2.3.1
10
+ - rvm: 2.3.5
11
+ - rvm: 2.4.2
data/README.md CHANGED
@@ -16,9 +16,11 @@ This tool is developed in working time for Cookpad.
16
16
  gem install xcprofiler
17
17
  ```
18
18
 
19
+ xcprofiler is tested on latest Ruby 2.3/2.4.
20
+
19
21
  ## Usage
20
22
 
21
- 1. Add `-Xfrontend -debug-time-function-bodies` build flags in `Other Swift Flags` section on your Xcode project.
23
+ 1. Add `-Xfrontend -debug-time-function-bodies` build flags in `Build Settings` -> `Other Swift Flags` section of your Xcode project.
22
24
  ![](https://raw.githubusercontent.com/giginet/xcprofiler/master/assets/build_flags.png)
23
25
 
24
26
  2. Build your project
@@ -76,7 +78,7 @@ Sample output is here
76
78
  |--order|-o|Sort order (default,time,file)|
77
79
  |--derived-data-path||Root path of DerivedData directory|
78
80
  |--truncate-at|-t|Truncate the method name with specified length|
79
- |--no-unique|Show the duplicated results|
81
+ |--no-unique||Show the duplicated results|
80
82
 
81
83
  ## Use custom reporters
82
84
 
@@ -100,6 +102,12 @@ You can also implement your own reporters.
100
102
 
101
103
  See implementation of [built-in reporters](https://github.com/giginet/xcprofiler/tree/master/lib/xcprofiler/reporters) for detail.
102
104
 
105
+ ## danger-xcprofiler
106
+
107
+ You can integrate xcprofiler to [danger](https://github.com/danger/danger).
108
+
109
+ https://github.com/giginet/danger-xcprofiler
110
+
103
111
  ## License
104
112
 
105
113
  MIT License
@@ -26,7 +26,7 @@ module Xcprofiler
26
26
  raise DerivedDataNotFound, 'Any matching derived data are not found'
27
27
  end
28
28
 
29
- derived_data.max_by { |data| data.updated_at }
29
+ derived_data.select { |data| !data.zero? }.max_by { |data| data.updated_at }
30
30
  end
31
31
 
32
32
  def default_derived_data_root
@@ -38,6 +38,10 @@ module Xcprofiler
38
38
  @path = path
39
39
  end
40
40
 
41
+ def zero?
42
+ File.zero?(@path)
43
+ end
44
+
41
45
  def updated_at
42
46
  File.mtime(@path)
43
47
  end
@@ -1,3 +1,3 @@
1
1
  module Xcprofiler
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
data/lib/xcprofiler.rb CHANGED
@@ -28,6 +28,7 @@ module Xcprofiler
28
28
  opts.on("--derived-data-path", String, "Root path of DerivedData") { |v| options.derived_data_path = v }
29
29
  opts.on("-t", "--truncate-at [TRUNCATE_AT]", Integer, "Truncate the method name with specified length") { |v| options.truncate_at = v }
30
30
  opts.on("--[no-]unique", "Reject duplicated location results or not") { |v| options.unique = v }
31
+ opts.on("--output [PATH]", String, "File path to output reporters' result") { |v| options.output = v }
31
32
  opts.on_tail("-h", "--help", "Show this message") do
32
33
  puts opts
33
34
  exit
@@ -50,12 +51,23 @@ module Xcprofiler
50
51
  derived_data_path = options[:derived_data_path]
51
52
  profiler = Profiler.by_product_name(target, derived_data_path)
52
53
  end
53
- profiler.reporters = [StandardOutputReporter.new(limit: options[:limit],
54
- threshold: options[:threshold],
55
- order: order,
56
- show_invalid_locations: options[:show_invalid_locations],
57
- truncate_at: options[:truncate_at],
58
- unique: options[:unique])]
54
+
55
+ reporter_args = {
56
+ limit: options[:limit],
57
+ threshold: options[:threshold],
58
+ order: order,
59
+ show_invalid_locations: options[:show_invalid_locations],
60
+ truncate_at: options[:truncate_at],
61
+ unique: options[:unique]
62
+ }
63
+ reporters = [StandardOutputReporter.new(reporter_args)]
64
+ if options[:output]
65
+ json_args = options.dup
66
+ json_args[:output] = options[:output]
67
+ reporters << JSONReporter.new(json_args)
68
+ end
69
+
70
+ profiler.reporters = reporters
59
71
  profiler.report!
60
72
  rescue Exception => e
61
73
  puts e.message.red
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcprofiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - giginet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-26 00:00:00.000000000 Z
11
+ date: 2017-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  requirements: []
146
146
  rubyforge_project:
147
- rubygems_version: 2.5.2
147
+ rubygems_version: 2.5.1
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: CLI to profile compilation time of Swift projects