xcprofiler 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/xcprofiler/derived_data.rb +7 -5
- data/lib/xcprofiler/profiler.rb +2 -2
- data/lib/xcprofiler/version.rb +1 -1
- data/lib/xcprofiler.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 103fbbc4b903014e4d52e1b7eddf59998944cd6e
|
4
|
+
data.tar.gz: 4d13c190c9cb6cd0247be41ba5700475f3e29726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7128ac3b10ea54dfc77fba6a05b697645ceafc4177126072a787b42b5bb0a56d16c9b65e2d6c29cc06a89e2948274d68d979c8c0e904415161d0de0e7c0e8aca
|
7
|
+
data.tar.gz: b55c3b8fd6794e52fe47913741eddfe2c852c39989ad5541c3980558eaec800c480cd937cce1f813103c013316df120dc1be97cbcc902982853e2f54b9535a86
|
data/README.md
CHANGED
@@ -74,6 +74,7 @@ Sample output is here
|
|
74
74
|
|--threshold||Threshold of time to display (ms)|
|
75
75
|
|--show-invalids||Show invalid location results|
|
76
76
|
|--order|-o|Sort order (default,time,file)|
|
77
|
+
|--derived_data_path||Root path of DerivedData directory|
|
77
78
|
|
78
79
|
## Use custom reporters
|
79
80
|
|
@@ -3,13 +3,15 @@ require 'zlib'
|
|
3
3
|
module Xcprofiler
|
4
4
|
class DerivedData
|
5
5
|
class << self
|
6
|
-
def all
|
7
|
-
|
6
|
+
def all(root = nil)
|
7
|
+
root ||= default_derived_data_root
|
8
|
+
pattern = File.join(root, "**", "Logs", "Build", "*.xcactivitylog")
|
8
9
|
by_pattern(pattern)
|
9
10
|
end
|
10
11
|
|
11
|
-
def by_product_name(product_name)
|
12
|
-
|
12
|
+
def by_product_name(product_name, root = nil)
|
13
|
+
root ||= default_derived_data_root
|
14
|
+
pattern = File.join(root, "#{product_name}-*", "Logs", "Build", "*.xcactivitylog")
|
13
15
|
by_pattern(pattern)
|
14
16
|
end
|
15
17
|
|
@@ -27,7 +29,7 @@ module Xcprofiler
|
|
27
29
|
derived_data.max_by { |data| data.updated_at }
|
28
30
|
end
|
29
31
|
|
30
|
-
def
|
32
|
+
def default_derived_data_root
|
31
33
|
File.expand_path('~/Library/Developer/Xcode/DerivedData')
|
32
34
|
end
|
33
35
|
end
|
data/lib/xcprofiler/profiler.rb
CHANGED
@@ -11,8 +11,8 @@ module Xcprofiler
|
|
11
11
|
Profiler.new(derived_data)
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.by_product_name(product_name)
|
15
|
-
derived_data = DerivedData.by_product_name(product_name)
|
14
|
+
def self.by_product_name(product_name, default_derived_data_root = nil)
|
15
|
+
derived_data = DerivedData.by_product_name(product_name, default_derived_data_root)
|
16
16
|
Profiler.new(derived_data)
|
17
17
|
end
|
18
18
|
|
data/lib/xcprofiler/version.rb
CHANGED
data/lib/xcprofiler.rb
CHANGED
@@ -24,6 +24,7 @@ module Xcprofiler
|
|
24
24
|
opts.on("-o [ORDER]", [:default, :time, :file], "Sort order") { |v| options.order = v }
|
25
25
|
opts.on("-l", "--limit [LIMIT]", Integer, "Limit for display") { |v| options.limit = v }
|
26
26
|
opts.on("--threshold [THRESHOLD]", Integer, "Threshold of time to display(ms)") { |v| options.threshold = v }
|
27
|
+
opts.on("--derived_data_path", String, "Root path of DerivedData") { |v| options.derived_data_path = v }
|
27
28
|
opts.on_tail("-h", "--help", "Show this message") do
|
28
29
|
puts opts
|
29
30
|
exit
|
@@ -43,7 +44,8 @@ module Xcprofiler
|
|
43
44
|
if target.end_with?('.xcactivitylog')
|
44
45
|
profiler = Profiler.by_path(target)
|
45
46
|
else
|
46
|
-
|
47
|
+
derived_data_path = options[:derived_data_path]
|
48
|
+
profiler = Profiler.by_product_name(target, derived_data_path)
|
47
49
|
end
|
48
50
|
profiler.reporters = [
|
49
51
|
StandardOutputReporter.new(limit: options[:limit],
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- giginet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|