fastlane-plugin-oclint_json_compilation_database 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/lib/fastlane/plugin/oclint_json_compilation_database.rb +16 -0
- data/lib/fastlane/plugin/oclint_json_compilation_database/actions/oclint_json_compilation_database_action.rb +140 -0
- data/lib/fastlane/plugin/oclint_json_compilation_database/version.rb +5 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 92d026b17be5d6a31b81998c6a52e337228bdc80562680c0cba8600028a09bbe
|
4
|
+
data.tar.gz: 75ad7c86bc673b04521b9cab9ca94296135e5d2f3ad58206e596dfeb4a70c6b3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d82493ef6c7570c1b2ea93cde04cb6fe30e218ce1f1d6601cbcaaa29b7e359d6feb176be52b249a6bad12e6b5a5fa6e9660efe45427d067319b45d450a184d88
|
7
|
+
data.tar.gz: d73da06169264e48d35479ea228cf3261e0d5bb503fb2c9f6fdd6a01fa797ef4d501c13716e63005e642e75a38a8507a5166bcd62d44a0520d9893cfce8dc4d0
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Marcin Stepnowski <marcin.s@meniga.com>
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# oclint_json_compilation_database plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-oclint_json_compilation_database)
|
4
|
+
[![Build Status](https://travis-ci.org/meniga/fastlane-plugin-oclint_json_compilation_database.svg?branch=master)](https://travis-ci.org/meniga/fastlane-plugin-oclint_json_compilation_database)
|
5
|
+
[![codecov](https://codecov.io/gh/meniga/fastlane-plugin-oclint_json_compilation_database/branch/master/graph/badge.svg)](https://codecov.io/gh/meniga/fastlane-plugin-oclint_json_compilation_database)
|
6
|
+
|
7
|
+
## Getting Started
|
8
|
+
|
9
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-oclint_json_compilation_database`, add it to your project by running:
|
10
|
+
|
11
|
+
```bash
|
12
|
+
fastlane add_plugin oclint_json_compilation_database
|
13
|
+
```
|
14
|
+
|
15
|
+
## About oclint_json_compilation_database
|
16
|
+
|
17
|
+
Run OCLint validation with oclint-json-compilation-database and fastlane :dart: :rocket:
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
|
+
|
23
|
+
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
24
|
+
|
25
|
+
## Run tests for this plugin
|
26
|
+
|
27
|
+
To run both the tests, and code style validation, run
|
28
|
+
|
29
|
+
```
|
30
|
+
rake
|
31
|
+
```
|
32
|
+
|
33
|
+
To automatically fix many of the styling issues, use
|
34
|
+
```
|
35
|
+
rubocop -a
|
36
|
+
```
|
37
|
+
|
38
|
+
## Issues and Feedback
|
39
|
+
|
40
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
41
|
+
|
42
|
+
## Troubleshooting
|
43
|
+
|
44
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
45
|
+
|
46
|
+
## Using _fastlane_ Plugins
|
47
|
+
|
48
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
49
|
+
|
50
|
+
## About _fastlane_
|
51
|
+
|
52
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/oclint_json_compilation_database/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module OclintJsonCompilationDatabase
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::OclintJsonCompilationDatabase.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,140 @@
|
|
1
|
+
require 'fastlane'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class OclintJsonCompilationDatabaseAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
cmd = []
|
8
|
+
cmd << (params[:executable] || "oclint-json-compilation-database").dup
|
9
|
+
|
10
|
+
build_path = params[:build_path]
|
11
|
+
if build_path
|
12
|
+
cmd << '-p'
|
13
|
+
cmd << build_path
|
14
|
+
end
|
15
|
+
|
16
|
+
include = Array(params[:include])
|
17
|
+
include.each do |path|
|
18
|
+
cmd << "--include"
|
19
|
+
cmd << path
|
20
|
+
end
|
21
|
+
|
22
|
+
exclude = Array(params[:exclude])
|
23
|
+
exclude.each do |path|
|
24
|
+
cmd << "--exclude"
|
25
|
+
cmd << path
|
26
|
+
end
|
27
|
+
|
28
|
+
oclint_args = []
|
29
|
+
report_type = params[:report_type]
|
30
|
+
if report_type
|
31
|
+
oclint_args << "-report-type"
|
32
|
+
oclint_args << report_type
|
33
|
+
end
|
34
|
+
|
35
|
+
oclint_args << "-enable-clang-static-analyzer" if params[:enable_clang_static_analyzer]
|
36
|
+
|
37
|
+
if oclint_args.any?
|
38
|
+
cmd << "--"
|
39
|
+
cmd << oclint_args
|
40
|
+
end
|
41
|
+
|
42
|
+
report_path = params[:report_path]
|
43
|
+
if report_path
|
44
|
+
cmd << ">>"
|
45
|
+
cmd << report_path
|
46
|
+
end
|
47
|
+
|
48
|
+
begin
|
49
|
+
Actions.sh(cmd.join(' '))
|
50
|
+
rescue
|
51
|
+
handle_error(params[:ignore_exit_status])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.handle_error(ignore_exit_status)
|
56
|
+
if ignore_exit_status
|
57
|
+
failure_suffix = 'which would normally fail the build.'
|
58
|
+
secondary_message = 'fastlane will continue because the `ignore_exit_status` option was used! 🙈'
|
59
|
+
else
|
60
|
+
failure_suffix = 'which represents a failure.'
|
61
|
+
secondary_message = 'If you want fastlane to continue anyway, use the `ignore_exit_status` option. 🙈'
|
62
|
+
end
|
63
|
+
|
64
|
+
UI.important("")
|
65
|
+
UI.important("oclint-json-compilation-database finished with status code other than 0, #{failure_suffix}")
|
66
|
+
UI.important(secondary_message)
|
67
|
+
UI.important("")
|
68
|
+
UI.user_error!("oclint-json-compilation-database finished with errors") unless ignore_exit_status
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.available_options
|
72
|
+
[
|
73
|
+
FastlaneCore::ConfigItem.new(key: :executable,
|
74
|
+
env_name: 'FL_OCLJCD_EXECUTABLE',
|
75
|
+
description: 'Path to the `oclint-json-compilation-database` executable on your machine',
|
76
|
+
optional: true,
|
77
|
+
type: String,
|
78
|
+
verify_block: proc do |value|
|
79
|
+
UI.user_error!("Couldn't find executable path '#{File.expand_path(value)}'") unless File.exist?(value)
|
80
|
+
end),
|
81
|
+
FastlaneCore::ConfigItem.new(key: :build_path,
|
82
|
+
env_name: 'FL_OCLJCD_BUILD_PATH',
|
83
|
+
description: 'Specify the directory containing compile_commands.json',
|
84
|
+
optional: true,
|
85
|
+
type: String),
|
86
|
+
FastlaneCore::ConfigItem.new(key: :include,
|
87
|
+
env_name: 'FL_OCLJCD_INCLUDE',
|
88
|
+
description: 'Extract files matching pattern',
|
89
|
+
optional: true,
|
90
|
+
type: Array),
|
91
|
+
FastlaneCore::ConfigItem.new(key: :exclude,
|
92
|
+
env_name: 'FL_OCLJCD_EXCLUDE',
|
93
|
+
description: 'Remove files matching pattern',
|
94
|
+
optional: true,
|
95
|
+
type: Array),
|
96
|
+
FastlaneCore::ConfigItem.new(key: :enable_clang_static_analyzer,
|
97
|
+
env_name: 'FL_OCLJCD_EXCLUDE_ENABLE_CLANG_STATIC_ANALYZER',
|
98
|
+
description: 'Enable Clang Static Analyzer, and integrate results into OCLint report',
|
99
|
+
optional: true,
|
100
|
+
default_value: false,
|
101
|
+
type: Boolean),
|
102
|
+
FastlaneCore::ConfigItem.new(key: :report_path,
|
103
|
+
env_name: 'FL_OCLJCD_REPORT_PATH',
|
104
|
+
description: 'The reports file path',
|
105
|
+
optional: true,
|
106
|
+
type: String),
|
107
|
+
FastlaneCore::ConfigItem.new(key: :report_type,
|
108
|
+
env_name: 'FL_OCLJCD_REPORT_TYPE',
|
109
|
+
description: 'The type of the report. Available: text, html, xml, json, pmd, xcode',
|
110
|
+
optional: true,
|
111
|
+
type: String,
|
112
|
+
verify_block: proc do |value|
|
113
|
+
available = ['text', 'html', 'xml', 'json', 'pmd', 'xcode']
|
114
|
+
UI.user_error!("Available values are '#{available.join("', '")}'") unless available.include?(value)
|
115
|
+
end),
|
116
|
+
FastlaneCore::ConfigItem.new(key: :ignore_exit_status,
|
117
|
+
env_name: "FL_OCLJCD_IGNORE_EXIT_STATUS",
|
118
|
+
description: "Ignore the exit status of the oclint-json-compilation-database command, so that serious violations \
|
119
|
+
don't fail the build (true/false)",
|
120
|
+
default_value: false,
|
121
|
+
type: Boolean,
|
122
|
+
optional: true)
|
123
|
+
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.category
|
128
|
+
:testing
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.is_supported?(_platform)
|
132
|
+
true
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.authors
|
136
|
+
["Marcin Stepnowski"]
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-oclint_json_compilation_database
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Meniga
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec_junit_formatter
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.49.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.49.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-require_tools
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: fastlane
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.146.1
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.146.1
|
139
|
+
description:
|
140
|
+
email: mobile.dev@meniga.com
|
141
|
+
executables: []
|
142
|
+
extensions: []
|
143
|
+
extra_rdoc_files: []
|
144
|
+
files:
|
145
|
+
- LICENSE
|
146
|
+
- README.md
|
147
|
+
- lib/fastlane/plugin/oclint_json_compilation_database.rb
|
148
|
+
- lib/fastlane/plugin/oclint_json_compilation_database/actions/oclint_json_compilation_database_action.rb
|
149
|
+
- lib/fastlane/plugin/oclint_json_compilation_database/version.rb
|
150
|
+
homepage: https://github.com/meniga/fastlane-plugin-oclint_json_compilation_database
|
151
|
+
licenses:
|
152
|
+
- MIT
|
153
|
+
metadata: {}
|
154
|
+
post_install_message:
|
155
|
+
rdoc_options: []
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
requirements: []
|
169
|
+
rubygems_version: 3.0.6
|
170
|
+
signing_key:
|
171
|
+
specification_version: 4
|
172
|
+
summary: 'Run OCLint validation with oclint-json-compilation-database and fastlane
|
173
|
+
:dart: :rocket:'
|
174
|
+
test_files: []
|