mysigner 0.1.4 → 0.1.5
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/Gemfile.lock +1 -1
- data/lib/mysigner/build/executor.rb +69 -29
- data/lib/mysigner/build/parser.rb +2 -2
- data/lib/mysigner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f363c20471bed89a90cb71ac4b6762cbeb5f05e3a7a015dd1e6b0f9a31186561
|
|
4
|
+
data.tar.gz: ea0bebacee050e567361bdd3d0803e74520fefe563ccfbc1bd83f857adc5cecf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2bdc172b95d45eec70359764baa3b6783ded9ec59798144521ea57c19e09d616d306ef18501428f568dc44204b950c9cde17b34e436f95c9d9f1d821ed3794a
|
|
7
|
+
data.tar.gz: 87ee8d47ef06e8b8fb2dbb96676a75e233b183702b3012b9a4864445ff7653100c2166504384c18a7220c4f4ff18f041a94dc2c7f417850eadcfab076f1ca2ce
|
data/Gemfile.lock
CHANGED
|
@@ -46,7 +46,11 @@ module Mysigner
|
|
|
46
46
|
# Execute build
|
|
47
47
|
success = execute_with_output(cmd)
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
unless success
|
|
50
|
+
msg = +'Build failed.'
|
|
51
|
+
msg << " Full log: #{@last_build_log}" if @last_build_log
|
|
52
|
+
raise BuildError, msg
|
|
53
|
+
end
|
|
50
54
|
|
|
51
55
|
# Verify archive was created
|
|
52
56
|
raise BuildError, "Build reported success but archive not found at: #{archive_path}" unless File.exist?(archive_path)
|
|
@@ -129,40 +133,76 @@ module Mysigner
|
|
|
129
133
|
puts ''
|
|
130
134
|
|
|
131
135
|
@build_errors = []
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
136
|
+
@last_build_log = log_path_for_run
|
|
137
|
+
|
|
138
|
+
# Capture every line so we can replay it on failure. xcodebuild's
|
|
139
|
+
# `-quiet` plus our keyword filter happily hides framework-loader
|
|
140
|
+
# errors, license issues, and anything that doesn't say "error:" —
|
|
141
|
+
# leaving the user with "Build failed" and nothing actionable. The
|
|
142
|
+
# log file (and tail dump on failure) keeps the full output recoverable.
|
|
143
|
+
File.open(@last_build_log, 'w') do |log|
|
|
144
|
+
# Run command and capture output in real-time
|
|
145
|
+
IO.popen(cmd, err: %i[child out]) do |io|
|
|
146
|
+
io.each_line do |line|
|
|
147
|
+
log.write(line)
|
|
148
|
+
|
|
149
|
+
# Filter output to show only important messages
|
|
150
|
+
next if line.strip.empty?
|
|
151
|
+
|
|
152
|
+
# Detect error lines (case-insensitive for error:)
|
|
153
|
+
# Check for various error patterns including curly quotes from Xcode
|
|
154
|
+
is_error = line.downcase.include?('error:') ||
|
|
155
|
+
line.include?('Provisioning profile') ||
|
|
156
|
+
line.include?('Code Sign error') ||
|
|
157
|
+
line.include?("doesn't support") ||
|
|
158
|
+
line.include?("doesn\u2019t support") ||
|
|
159
|
+
line.include?('capability')
|
|
160
|
+
|
|
161
|
+
is_warning = line.downcase.include?('warning:')
|
|
162
|
+
|
|
163
|
+
# Show and capture errors and warnings
|
|
164
|
+
if is_error || is_warning
|
|
165
|
+
puts line
|
|
166
|
+
@build_errors << line if is_error
|
|
167
|
+
# Show progress markers
|
|
168
|
+
elsif line.include?('Building') || line.include?('Compiling') ||
|
|
169
|
+
line.include?('Linking') || line.include?('Signing') ||
|
|
170
|
+
line.include?('Copying')
|
|
171
|
+
print '.'
|
|
172
|
+
end
|
|
159
173
|
end
|
|
160
174
|
end
|
|
161
175
|
end
|
|
162
176
|
|
|
163
177
|
puts '' # New line after dots
|
|
164
178
|
|
|
165
|
-
$CHILD_STATUS.success?
|
|
179
|
+
success = $CHILD_STATUS.success?
|
|
180
|
+
dump_log_tail(@last_build_log) unless success
|
|
181
|
+
success
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def log_path_for_run
|
|
185
|
+
log_dir = File.join(@project_info[:directory], 'build')
|
|
186
|
+
FileUtils.mkdir_p(log_dir)
|
|
187
|
+
File.join(log_dir, 'last-build.log')
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def dump_log_tail(path, lines: 80)
|
|
191
|
+
return unless File.exist?(path)
|
|
192
|
+
|
|
193
|
+
tail = File.foreach(path).each_with_object([]) do |line, buf|
|
|
194
|
+
buf << line
|
|
195
|
+
buf.shift if buf.size > lines
|
|
196
|
+
end
|
|
197
|
+
return if tail.empty?
|
|
198
|
+
|
|
199
|
+
puts ''
|
|
200
|
+
puts '─' * 80
|
|
201
|
+
puts "Build output (last #{tail.size} lines):"
|
|
202
|
+
puts '─' * 80
|
|
203
|
+
puts tail.join
|
|
204
|
+
puts '─' * 80
|
|
205
|
+
puts "Full log: #{path}"
|
|
166
206
|
end
|
|
167
207
|
end
|
|
168
208
|
end
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'xcodeproj'
|
|
4
|
-
|
|
5
3
|
module Mysigner
|
|
6
4
|
module Build
|
|
7
5
|
class Parser
|
|
@@ -184,6 +182,8 @@ module Mysigner
|
|
|
184
182
|
end
|
|
185
183
|
|
|
186
184
|
def open_project
|
|
185
|
+
require 'xcodeproj'
|
|
186
|
+
|
|
187
187
|
if @project_info[:type] == :workspace
|
|
188
188
|
# Workspace contains multiple projects
|
|
189
189
|
# Get the main project (not Pods)
|
data/lib/mysigner/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mysigner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jurgen Leka
|
|
@@ -308,7 +308,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
308
308
|
- !ruby/object:Gem::Version
|
|
309
309
|
version: '0'
|
|
310
310
|
requirements: []
|
|
311
|
-
rubygems_version:
|
|
311
|
+
rubygems_version: 4.0.11
|
|
312
312
|
specification_version: 4
|
|
313
313
|
summary: CLI tool for iOS and Android code signing automation via My Signer API
|
|
314
314
|
test_files: []
|