xcpretty-custom-print-formatter 1.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e5df590a2b811d69a4322245ad02c91d9aa6e379bf08c9e5454b65d010229921
4
+ data.tar.gz: 4c7c3ead5edc12d1950f9e0e8f655889350a7f8f957d65143db3e08a8a8c8229
5
+ SHA512:
6
+ metadata.gz: 3e151500ec4a0667d3d298ee0717c03b3c5c83eb11f3d5d55ff01a74d2b8951a5b48a3717c458c36e6343a5f7fbaa07a4e74070f9fc49fdf4d2ef350e9dfc07f
7
+ data.tar.gz: 52b968b4dd96c58b8d5e84d4cf98e77c9cdefeedf707ffc037e55c126174914b298865530e255a21ed0846faa82f93535953ffdb3984d4219418d7e20ed3ea00
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Delisa Mason
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,25 @@
1
+ # XCPretty Formatter
2
+
3
+ Custom formatter for [xcpretty](https://github.com/supermarin/xcpretty).
4
+
5
+ Custom formatter for [xcpretty](https://github.com/supermarin/xcpretty) with some syntactic sugar for presentation on Jenkins.
6
+
7
+ ## Installation
8
+
9
+ This formatter is distributed via RubyGems, and depends on a version of `xcpretty` >= 0.0.7 (when custom formatters were introduced). Run:
10
+
11
+ gem install xcpretty-custom-print-formatter
12
+
13
+ ## Usage
14
+
15
+ Specify `xcpretty-custom-print-formatter` as a custom formatter to `xcpretty`:
16
+
17
+ ```bash
18
+ #!/bin/bash
19
+
20
+ xcodebuild | xcpretty -f `xcpretty-custom-print-formatter`
21
+ ```
22
+
23
+ ## How it works
24
+
25
+ The `--formatter` option takes a file path as an argument, which is returned by the `xcpretty-custom-print-formatter` binary. It must be evaluated before the xcpretty arguments are evaluated, hence the backtick wrapping. The specified file must return a Ruby subclass of `XCPretty::Formatter`, which will then receive `formatter_*` method invocations as the build output is parsed.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ print File.expand_path('../../lib/custom_print_formatter.rb', __FILE__)
@@ -0,0 +1,46 @@
1
+
2
+ class CustomPrintFormatter < XCPretty::Simple
3
+
4
+ ERROR_TEXT = 'error: '
5
+ WARNING_TEXT = 'warning: '
6
+
7
+ def format_error(message)
8
+ "#{ERROR_TEXT + " " + message}\n"
9
+ end
10
+
11
+ def format_compile_error(file, file_path, reason, line, cursor)
12
+ "#{ERROR_TEXT + " "}#{file_path}: #{reason}\n" \
13
+ "#{line}\n#{cursor}\n"
14
+ end
15
+
16
+ def format_file_missing_error(reason, file_path)
17
+ "#{ERROR_TEXT + " " + reason} #{file_path}\n"
18
+ end
19
+
20
+ def format_compile_warning(file, file_path, reason, line, cursor)
21
+ "#{WARNING_TEXT + ' '}#{file_path}: #{reason}\n" \
22
+ "#{line}\n#{cursor}\n"
23
+ end
24
+
25
+ def format_ld_warning(reason)
26
+ "#{WARNING_TEXT + ' ' + reason}"
27
+ end
28
+
29
+ def format_undefined_symbols(message, symbol, reference)
30
+ "#{ERROR_TEXT + " " + message}\n" \
31
+ "> Symbol: #{symbol}\n" \
32
+ "> Referenced from: #{reference}\n"
33
+ end
34
+
35
+ def format_duplicate_symbols(message, file_paths)
36
+ "#{ERROR_TEXT + " " + message}\n" \
37
+ "> #{file_paths.map { |path| path.split('/').last }.join("\n> ")}\n"
38
+ end
39
+
40
+ def format_will_not_be_code_signed(message)
41
+ "#{WARNING_TEXT + " " + message}"
42
+ end
43
+
44
+ end
45
+
46
+ CustomPrintFormatter
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xcpretty-custom-print-formatter
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - frozenrain yoo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-06-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: xcpretty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.7
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '0.2'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.0.7
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '0.2'
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.3'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.3'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: bacon
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '1.2'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '1.2'
75
+ description: "\n Formatter for xcpretty customized to provide pretty custom output\n
76
+ \ "
77
+ email:
78
+ - frozenrain.yoo@gmail.com
79
+ executables:
80
+ - xcpretty-custom-print-formatter
81
+ extensions: []
82
+ extra_rdoc_files: []
83
+ files:
84
+ - LICENSE
85
+ - README.md
86
+ - bin/xcpretty-custom-print-formatter
87
+ - lib/custom_print_formatter.rb
88
+ homepage: https://github.com/frozenrainyoo/xcpretty-custom-print-formatter
89
+ licenses:
90
+ - MIT
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '2.0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubygems_version: 3.0.3
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: xcpretty custom formatter
111
+ test_files: []