xcpretty-azure-pipelines-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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5f3f2bc437ee480bc5e09227bed117170c4524b3
4
+ data.tar.gz: fa593c1f1dbf510b3b7a8da2ae625acea6ca20ba
5
+ SHA512:
6
+ metadata.gz: 3f28dab4b6bd0c8666d7d998fac77f015cabc4b3d4313c10a53760f851dfa57bc95ce8f04696e40c7a76264f1c390e05d018d1f52ce57ff22aac48cc79290eb6
7
+ data.tar.gz: ded0067bca9daa69910b0dfecbcdf1e9e9c8b7d72ccf0fa4c25b513697bebbe43e4832fc83748566a40820e58fca129eb8673f10093bb5248ee17e1cb0a5397a
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.
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # XCPretty Azure Pipelines Formatter
2
+
3
+ Custom formatter for [xcpretty](https://github.com/supermarin/xcpretty) with some syntactic sugar for presentation on Azure Pipelines.
4
+
5
+ ## Usage
6
+
7
+ Specify `xcpretty-azure-pipelines-formatter` as a custom formatter to `xcpretty`:
8
+
9
+ ```bash
10
+ #!/bin/bash
11
+
12
+ xcodebuild | xcpretty -f `xcpretty-azure-pipelines-formatter`
13
+ ```
14
+
15
+ ## How it works
16
+
17
+ The `--formatter` option takes a file path as an argument, which is returned by the `xcpretty-azure-pipelines-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/azure_pipelines_formatter.rb', __FILE__)
@@ -0,0 +1,33 @@
1
+
2
+ class AzurePipelinesFormatter < XCPretty::Simple
3
+
4
+ def logIssue(type, path, message)
5
+ if path == nil
6
+ message.sub!("error: ", "")
7
+ STDOUT.puts "##vso[task.logissue type=#{type}]#{message}"
8
+ return
9
+ end
10
+ matches = path.match(/^(.+):([0-9]+):([0-9]+)+$/)
11
+ if matches == nil
12
+ STDOUT.puts "##vso[task.logissue type=#{type};sourcepath=#{path}]#{message}"
13
+ else
14
+ sourcepath = matches[1]
15
+ line = matches[2]
16
+ column = matches[3]
17
+ STDOUT.puts "##vso[task.logissue type=#{type};sourcepath=#{sourcepath};linenumber=#{line};columnnumber=#{column};]#{message}"
18
+ end
19
+ end
20
+
21
+ # Errors and warnings.
22
+ def format_compile_error(file_name, file_path, reason, line, cursor); logIssue("error", file_path, reason); super; end
23
+ def format_error(message); logIssue("error", nil, message); super; end
24
+ def format_file_missing_error(error, file_path); super; end
25
+ def format_ld_warning(message); logIssue("warning", nil, message); super; end
26
+ def format_undefined_symbols(message, symbol, reference); super; end
27
+ def format_duplicate_symbols(message, file_paths); super; end
28
+ def format_warning(message); logIssue("warning", nil, message); super; end
29
+ def format_compile_warning(file_name, file_path, reason, line, cursor); logIssue("warning", file_path, reason); super; end
30
+
31
+ end
32
+
33
+ AzurePipelinesFormatter
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xcpretty-azure-pipelines-formatter
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jonathan Bailey
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-07-19 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.2'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.7
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '0.2'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.0.7
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
+ description: "\n Formatter for xcpretty customized to provide pretty output on Azure
48
+ Pipelines\n "
49
+ email:
50
+ - ''
51
+ executables:
52
+ - xcpretty-azure-pipelines-formatter
53
+ extensions: []
54
+ extra_rdoc_files: []
55
+ files:
56
+ - LICENSE
57
+ - README.md
58
+ - bin/xcpretty-azure-pipelines-formatter
59
+ - lib/azure_pipelines_formatter.rb
60
+ homepage: https://github.com/jon889/xcpretty-azure-pipelines-formatter
61
+ licenses:
62
+ - MIT
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '2.0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.5.2.3
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: xcpretty custom formatter for Azure Pipelines
84
+ test_files: []