app-tools 1.12.0 → 1.14.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/gencov +34 -16
  3. data/lib/app_tools/version.rb +1 -1
  4. metadata +23 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f5f0ef726971c727440441b5c6b08630429f619
4
- data.tar.gz: 550a0496be2a8d2c58f87dfcce8a4cfbd0c24207
3
+ metadata.gz: c6aec02839ce2d8c9edadcd56d6d8336a96999b2
4
+ data.tar.gz: f7136e83521ca43302caab96a5bdab351fa1e6c7
5
5
  SHA512:
6
- metadata.gz: f479646f4d645fbfccf26da805d1ab0019db22bbe67775cd783b0a9b201710d6b8d50d82aa6fec5a25f92b0bcf65c7bdec2b52bec907b7c4a9745dfae4342816
7
- data.tar.gz: 61b3f838460ee4e072a121d6a5debbdf354fe132f8eaae75dc9a283f099aeb58d8b352b86cd5fcce6c5ee0224182d6861cc879f567ef0d627326bba2362f845f
6
+ metadata.gz: 3db21985a67d7a98ed3683cde078724214377c6f0186660eb9b308cbe98b45d3e1653fe45e1d75bbf446a78652d373f0a5ff4228d48eaa32108f862eedff1561
7
+ data.tar.gz: 22d337c0ef4f637af3552ab5eb908f3206dbba7f92f6338e779ae3401bb46caff2daf24ae7b17017b13ea598c7020ad2c0bc68a0935f9faa78147b935f027517
data/bin/gencov CHANGED
@@ -39,14 +39,25 @@ module AppTools
39
39
  end
40
40
  end
41
41
 
42
- main do |xcfile, directory|
42
+ main do |xcfile, source_dir|
43
43
  if xcfile.end_with?(".xcodeproj")
44
44
  xcflag = "-project"
45
45
  elsif xcfile.end_with?(".xcworkspace")
46
46
  xcflag = "-workspace"
47
47
  end
48
48
 
49
+ xcfile = File.expand_path(xcfile)
50
+
51
+ if !File.exist?(xcfile)
52
+ exit_now! "Xcode file '#{xcfile}' does not exist"
53
+ end
54
+
49
55
  scheme = options[:s]
56
+ derived_data_dir = File.expand_path(options[:d])
57
+
58
+ if !Dir.exist?(derived_data_dir)
59
+ exit_now! "DerivedData directory '#{derived_data_dir}' does not exist"
60
+ end
50
61
 
51
62
  build_settings_file = Tempfile.new('gencov')
52
63
  pid = Process.spawn("xcodebuild #{xcflag} #{xcfile} -scheme #{scheme} -sdk iphonesimulator -showBuildSettings",
@@ -61,28 +72,32 @@ module AppTools
61
72
  end
62
73
  end
63
74
 
64
- coverage_root = File.join(build_settings['PROJECT_TEMP_ROOT'], "CodeCoverage")
75
+ coverage_filename = 'Coverage.profdata'
76
+ profdata_paths = `find #{derived_data_dir} -name #{coverage_filename}`.split(/\n/)
77
+ profdata_path = nil
78
+ app_path = nil
65
79
 
66
- if !Dir.exist?(coverage_root)
67
- exit_now! "Could not find coverage root dir #{coverage_root}. Was Xcode upgraded?"
80
+ if profdata_paths.length > 0
81
+ profdata_path = profdata_paths[0]
82
+ else
83
+ exit_now! "Could not find #{coverage_filename}$ in '#{derived_data_dir}'"
68
84
  end
69
85
 
70
86
  app_name = build_settings['EXECUTABLE_NAME']
71
- profdata_path = File.join(coverage_root, "Coverage.profdata")
87
+ debug_sim_dir = 'Debug-iphonesimulator'
72
88
 
89
+ app_paths = `find #{derived_data_dir} -path */#{debug_sim_dir}/#{app_name}.app`.split(/\n/)
73
90
 
74
- if !File.exist?(profdata_path)
75
- exit_now! "Could not find coverage file #{profdata_path}. Is code coverage enabled in the scheme '#{scheme}'?"
91
+ if app_paths.length > 0
92
+ app_path = app_paths[0]
93
+ else
94
+ exit_now! "Could not find '#{debug_sim_dir}/#{app_name}.app' under #{derived_data_dir}"
76
95
  end
77
96
 
78
- binary_path = `find #{coverage_root} -path *#{app_name}.app/#{app_name}`.chomp
79
-
80
- if $?.exitstatus != 0
81
- exit_now! "Could not find #{app_name} under #{coverage_root}"
82
- end
97
+ binary_path = File.join(app_path, app_name)
83
98
 
84
- directory = File.expand_path(directory)
85
- source_files = `find #{directory} -type f \\( -name "*.m" -or -name "*.h" -or -name "*.swift" \\)`.lines
99
+ source_dir = File.expand_path(source_dir)
100
+ source_files = `find #{source_dir} -type f \\( -name "*.m" -or -name "*.h" -or -name "*.swift" \\)`.lines
86
101
 
87
102
  STDERR.puts("Found #{source_files.length} source files")
88
103
 
@@ -99,7 +114,9 @@ module AppTools
99
114
  next
100
115
  end
101
116
 
102
- file_coverage = `xcrun llvm-cov report -instr-profile #{profdata_path} #{binary_path} "#{source_file}"`
117
+ command = "xcrun llvm-cov report -instr-profile #{profdata_path} #{binary_path} '#{source_file}'"
118
+ #puts(command)
119
+ file_coverage = `#{command}`
103
120
 
104
121
  file_coverage.each_line do |line|
105
122
  if /^TOTAL *(.*)$/.match(line)
@@ -145,9 +162,10 @@ module AppTools
145
162
 
146
163
  on("-s", "--scheme SCHEME", "Schema to use for the project or workspace")
147
164
  on("-j", "--json", "Output in JSON format instead of YAML")
165
+ on("-d", "--deriveddata DERIVEDDATADIR", "Override location of DerivedData directory")
148
166
 
149
167
  arg :xcfile, "The .xcodeproj or .xcworkspace file", :require
150
- arg :directory, "The directory to generate coverage for", :require
168
+ arg :source_dir, "The source directory to generate coverage for", :require
151
169
 
152
170
  use_log_level_option :toggle_debug_on_signal => 'USR1'
153
171
 
@@ -1,3 +1,3 @@
1
1
  module AppTools
2
- VERSION = "1.12.0"
2
+ VERSION = "1.14.0"
3
3
  end
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Lyon-Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-28 00:00:00.000000000 Z
11
+ date: 2016-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.10'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.10'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: code-tools
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '5.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
54
  version: '5.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: methadone
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.9'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.9'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: CFPropertyList
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rubyzip
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.1'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: spaceship
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0.26'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.26'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: highline
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '1.7'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.7'
125
125
  description: |
@@ -139,7 +139,6 @@ executables:
139
139
  extensions: []
140
140
  extra_rdoc_files: []
141
141
  files:
142
- - lib/app_tools/version.rb
143
142
  - bin/app-tools
144
143
  - bin/gencov
145
144
  - bin/kcpass
@@ -148,6 +147,7 @@ files:
148
147
  - bin/syncpp
149
148
  - bin/upload2itunes
150
149
  - bin/xcarchive2ipa
150
+ - lib/app_tools/version.rb
151
151
  homepage: http://github.com/jlyonsmith/app-tools
152
152
  licenses:
153
153
  - MIT
@@ -158,17 +158,17 @@ require_paths:
158
158
  - lib
159
159
  required_ruby_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ~>
161
+ - - "~>"
162
162
  - !ruby/object:Gem::Version
163
- version: '2.0'
163
+ version: '2.2'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - '>='
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.0.14.1
171
+ rubygems_version: 2.4.5
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Tools for creating iPhone apps