xcpretty-azure-formatter 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/bin/xcpretty-azure-formatter +4 -0
- data/lib/xcpretty_azure_formatter.rb +57 -0
- metadata +75 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 06abaa62c8db2eb8204574f7d72e256b8ca9aec0318354349e85ad7faf0e5fd8
|
4
|
+
data.tar.gz: '08589dde88e1fa33404a1263c5810d51b24e84f6f9d46c3431f1111050765783'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 90e1ffd950ffd6b64424944ad76ea818a99c135710ab25971a968263fbe94c9cc58183a7354e49fe37f51a53449a21e2790057731898a752fa1550c1226fc9a5
|
7
|
+
data.tar.gz: 30ba47953b976a83de28708c4c320575014343d444132434fe670e7ae22508ae87f5ffeeec1a2b9f9b3d1201be4af7bbc005abfe8fb6cf3367a3f746edddf656
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 TODO: Write your name
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# xcpretty-azure-formatter
|
2
|
+
|
3
|
+
![Build](https://github.com/lasseporsch/xcpretty-azure-formatter/actions/workflows/main.yml/badge.svg)
|
4
|
+
|
5
|
+
This xcpretty formatter produces additional [Azure Pipelines LogIssue](https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#logissue-log-an-error-or-warning) commands so xcodebuild errors and warnigns can be reported to the Azure Pipeline environment.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'xcpretty-azure-formatter'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install xcpretty_azure_formatter
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Simply specify the azure formatter when using `xcpretty`. Be sure to use back-ticks. For more details see the [xcpretty documentation](https://github.com/xcpretty/xcpretty#extensions)
|
26
|
+
```bash
|
27
|
+
$ xcodebuild [args] build | xcpretty -f `xcpretty-azure-formatter`
|
28
|
+
```
|
29
|
+
This will retain the original output of xcpretty, and print the appropriate Azure Logging Commands as well.
|
30
|
+
s
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/xcpretty_azure_formatter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/xcpretty_azure_formatter/blob/master/CODE_OF_CONDUCT.md).
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
38
|
+
|
39
|
+
## Code of Conduct
|
40
|
+
|
41
|
+
Everyone interacting in the XcprettyAzureFormatter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/xcpretty_azure_formatter/blob/master/CODE_OF_CONDUCT.md).
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# xcpretty formatter for Azure Pipelines
|
4
|
+
class AzureFormatter < XCPretty::Simple
|
5
|
+
def format_ld_warning(message)
|
6
|
+
_log_issue("warning", message, nil)
|
7
|
+
super
|
8
|
+
end
|
9
|
+
|
10
|
+
def format_warning(message)
|
11
|
+
_log_issue("warning", message, nil)
|
12
|
+
super
|
13
|
+
end
|
14
|
+
|
15
|
+
def format_compile_warning(file_name, file_path, reason, line, cursor)
|
16
|
+
_log_issue("warning", reason, file_path)
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def format_error(message)
|
21
|
+
_log_issue("error", message, nil)
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
def format_compile_error(file, file_path, reason, line, cursor)
|
26
|
+
_log_issue("error", reason, file_path)
|
27
|
+
super
|
28
|
+
end
|
29
|
+
|
30
|
+
def format_file_missing_error(reason, file_path)
|
31
|
+
_log_issue("error", reason, file_path)
|
32
|
+
super
|
33
|
+
end
|
34
|
+
|
35
|
+
def format_undefined_symbols(message, symbol, reference)
|
36
|
+
_log_issue("error", message, nil)
|
37
|
+
super
|
38
|
+
end
|
39
|
+
|
40
|
+
def format_duplicate_symbols(message, file_paths)
|
41
|
+
_log_issue("error", message, nil)
|
42
|
+
super
|
43
|
+
end
|
44
|
+
|
45
|
+
def _log_issue(type, message, file)
|
46
|
+
log_params = "type=#{type}"
|
47
|
+
unless file.nil?
|
48
|
+
log_params += ";sourcepath=#{file[0]}"
|
49
|
+
log_params += ";linenumber=#{file[1]}" if file.length >= 2
|
50
|
+
log_params += ";columnnumber=#{file[2]}" if file.length >= 3
|
51
|
+
log_params += ";"
|
52
|
+
end
|
53
|
+
puts "##vso[task.logissue #{log_params}]#{message}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
AzureFormatter
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xcpretty-azure-formatter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Lasse Porsch
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-06-17 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
|
+
description: "\n This custom XCPretty Formatter converts relevant xcodebuild output
|
34
|
+
into Azure Pipelines logging commands\n (see https://docs.microsoft.com/en-us/azure/devops/pipelines/scripts/logging-commands?view=azure-devops&tabs=bash#logissue-log-an-error-or-warning)\n
|
35
|
+
\ The Formatter was written with a focus on reporting build warnings and errors
|
36
|
+
to the Azure environment, e.g. in Dashboards.\n "
|
37
|
+
email:
|
38
|
+
- lasse.porsch@gmail.com
|
39
|
+
executables:
|
40
|
+
- xcpretty-azure-formatter
|
41
|
+
extensions: []
|
42
|
+
extra_rdoc_files: []
|
43
|
+
files:
|
44
|
+
- LICENSE.txt
|
45
|
+
- README.md
|
46
|
+
- bin/xcpretty-azure-formatter
|
47
|
+
- lib/xcpretty_azure_formatter.rb
|
48
|
+
homepage: https://github.com/lasseporsch/xcpretty-azure-formatter
|
49
|
+
licenses:
|
50
|
+
- MIT
|
51
|
+
metadata:
|
52
|
+
homepage_uri: https://github.com/lasseporsch/xcpretty-azure-formatter
|
53
|
+
source_code_uri: https://github.com/lasseporsch/xcpretty-azure-formatter
|
54
|
+
changelog_uri: https://github.com/lasseporsch/xcpretty-azure-formatter/blob/master/CHANGELOG.md
|
55
|
+
post_install_message:
|
56
|
+
rdoc_options: []
|
57
|
+
require_paths:
|
58
|
+
- lib
|
59
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 2.6.0
|
64
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
requirements: []
|
70
|
+
rubygems_version: 3.0.3
|
71
|
+
signing_key:
|
72
|
+
specification_version: 4
|
73
|
+
summary: An xcpretty Formatter to report xcodebuild warnings and errors directly to
|
74
|
+
Azure Pipelines
|
75
|
+
test_files: []
|