cocoapods-lint-onlyx64 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +110 -0
- data/LICENSE.txt +22 -0
- data/README.md +13 -0
- data/Rakefile +13 -0
- data/cocoapods-lint-onlyx64.gemspec +24 -0
- data/lib/cocoapods-lint-onlyx64.rb +1 -0
- data/lib/cocoapods-lint-onlyx64/command.rb +1 -0
- data/lib/cocoapods-lint-onlyx64/command/onlyx64.rb +313 -0
- data/lib/cocoapods-lint-onlyx64/gem_version.rb +3 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/spec/command/onlyx64_spec.rb +12 -0
- data/spec/spec_helper.rb +50 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c4f56b32e657508627fea03c83e0bd0c3a1871c8a5d4a30c2961d0496dffb130
|
4
|
+
data.tar.gz: d53dc83d077c464f4bcd70d4915133c9558e005b507e356cb5d929a4a4ebff56
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0a8a579a4b9166beb709a9b439d7318351944dc0545e52847cf761a0cabd9dc6d46e07e886740348ecc45b8d975adb465949bf0a4298c029d5567a03fa123658
|
7
|
+
data.tar.gz: 1e78c1e4ec58143b4a08d6ffe416fe3d0e08da2375c8f26bf4bc764c8846d068ad08f2a22fd109ba7384d0b0e43e960b9f41f054b134cdd4c5939a5b60395f7c
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cocoapods-lint-onlyx64 (0.1.0)
|
5
|
+
cocoapods (= 1.9.3)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
CFPropertyList (3.0.2)
|
11
|
+
activesupport (4.2.11.3)
|
12
|
+
i18n (~> 0.7)
|
13
|
+
minitest (~> 5.1)
|
14
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
algoliasearch (1.27.4)
|
17
|
+
httpclient (~> 2.8, >= 2.8.3)
|
18
|
+
json (>= 1.5.1)
|
19
|
+
atomos (0.1.3)
|
20
|
+
bacon (1.2.0)
|
21
|
+
claide (1.0.3)
|
22
|
+
cocoapods (1.9.3)
|
23
|
+
activesupport (>= 4.0.2, < 5)
|
24
|
+
claide (>= 1.0.2, < 2.0)
|
25
|
+
cocoapods-core (= 1.9.3)
|
26
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
27
|
+
cocoapods-downloader (>= 1.2.2, < 2.0)
|
28
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
29
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
30
|
+
cocoapods-stats (>= 1.0.0, < 2.0)
|
31
|
+
cocoapods-trunk (>= 1.4.0, < 2.0)
|
32
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
33
|
+
colored2 (~> 3.1)
|
34
|
+
escape (~> 0.0.4)
|
35
|
+
fourflusher (>= 2.3.0, < 3.0)
|
36
|
+
gh_inspector (~> 1.0)
|
37
|
+
molinillo (~> 0.6.6)
|
38
|
+
nap (~> 1.0)
|
39
|
+
ruby-macho (~> 1.4)
|
40
|
+
xcodeproj (>= 1.14.0, < 2.0)
|
41
|
+
cocoapods-core (1.9.3)
|
42
|
+
activesupport (>= 4.0.2, < 6)
|
43
|
+
algoliasearch (~> 1.0)
|
44
|
+
concurrent-ruby (~> 1.1)
|
45
|
+
fuzzy_match (~> 2.0.4)
|
46
|
+
nap (~> 1.0)
|
47
|
+
netrc (~> 0.11)
|
48
|
+
typhoeus (~> 1.0)
|
49
|
+
cocoapods-deintegrate (1.0.4)
|
50
|
+
cocoapods-downloader (1.4.0)
|
51
|
+
cocoapods-plugins (1.0.0)
|
52
|
+
nap
|
53
|
+
cocoapods-search (1.0.0)
|
54
|
+
cocoapods-stats (1.1.0)
|
55
|
+
cocoapods-trunk (1.5.0)
|
56
|
+
nap (>= 0.8, < 2.0)
|
57
|
+
netrc (~> 0.11)
|
58
|
+
cocoapods-try (1.2.0)
|
59
|
+
colored2 (3.1.2)
|
60
|
+
concurrent-ruby (1.1.7)
|
61
|
+
escape (0.0.4)
|
62
|
+
ethon (0.12.0)
|
63
|
+
ffi (>= 1.3.0)
|
64
|
+
ffi (1.13.1)
|
65
|
+
fourflusher (2.3.1)
|
66
|
+
fuzzy_match (2.0.4)
|
67
|
+
gh_inspector (1.1.3)
|
68
|
+
httpclient (2.8.3)
|
69
|
+
i18n (0.9.5)
|
70
|
+
concurrent-ruby (~> 1.0)
|
71
|
+
json (2.3.1)
|
72
|
+
minitest (5.14.2)
|
73
|
+
mocha (1.11.2)
|
74
|
+
mocha-on-bacon (0.2.3)
|
75
|
+
mocha (>= 0.13.0)
|
76
|
+
molinillo (0.6.6)
|
77
|
+
nanaimo (0.3.0)
|
78
|
+
nap (1.1.0)
|
79
|
+
netrc (0.11.0)
|
80
|
+
prettybacon (0.0.2)
|
81
|
+
bacon (~> 1.2)
|
82
|
+
rake (13.0.1)
|
83
|
+
ruby-macho (1.4.0)
|
84
|
+
thread_safe (0.3.6)
|
85
|
+
typhoeus (1.4.0)
|
86
|
+
ethon (>= 0.9.0)
|
87
|
+
tzinfo (1.2.7)
|
88
|
+
thread_safe (~> 0.1)
|
89
|
+
xcodeproj (1.18.0)
|
90
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
91
|
+
atomos (~> 0.1.3)
|
92
|
+
claide (>= 1.0.2, < 2.0)
|
93
|
+
colored2 (~> 3.1)
|
94
|
+
nanaimo (~> 0.3.0)
|
95
|
+
|
96
|
+
PLATFORMS
|
97
|
+
ruby
|
98
|
+
|
99
|
+
DEPENDENCIES
|
100
|
+
bacon
|
101
|
+
bundler
|
102
|
+
cocoapods
|
103
|
+
cocoapods-lint-onlyx64!
|
104
|
+
mocha
|
105
|
+
mocha-on-bacon
|
106
|
+
prettybacon
|
107
|
+
rake
|
108
|
+
|
109
|
+
BUNDLED WITH
|
110
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2020 徐仲平 <zhongping.xu@ushow.media>
|
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
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-lint-onlyx64/gem_version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'cocoapods-lint-onlyx64'
|
8
|
+
spec.version = CocoapodsLintOnlyx64::VERSION
|
9
|
+
spec.authors = ['nakahira']
|
10
|
+
spec.email = ['1021057927@qq.com']
|
11
|
+
spec.description = %q{A short description of cocoapods-lint-onlyx64.}
|
12
|
+
spec.summary = %q{A longer description of cocoapods-lint-onlyx64.}
|
13
|
+
spec.homepage = 'https://github.com/xuzhongping/cocoapods-lint-onlyx64'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_dependency 'cocoapods', '1.9.3'
|
24
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-lint-onlyx64/gem_version'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-lint-onlyx64/command/onlyx64'
|
@@ -0,0 +1,313 @@
|
|
1
|
+
module Pod
|
2
|
+
class Validator
|
3
|
+
attr_accessor :only_x64
|
4
|
+
def xcodebuild(action, scheme, configuration)
|
5
|
+
require 'fourflusher'
|
6
|
+
command = %W(clean #{action} -workspace #{File.join(validation_dir, 'App.xcworkspace')} -scheme #{scheme} -configuration #{configuration})
|
7
|
+
case consumer.platform_name
|
8
|
+
when :osx, :macos
|
9
|
+
command += %w(CODE_SIGN_IDENTITY=)
|
10
|
+
when :ios
|
11
|
+
command += %w(CODE_SIGN_IDENTITY=- -sdk iphonesimulator)
|
12
|
+
command += Fourflusher::SimControl.new.destination(:oldest, 'iOS', deployment_target)
|
13
|
+
xcconfig = consumer.pod_target_xcconfig
|
14
|
+
if xcconfig
|
15
|
+
archs = xcconfig['VALID_ARCHS']
|
16
|
+
if archs && (archs.include? 'armv7') && !(archs.include? 'i386') && (archs.include? 'x86_64')
|
17
|
+
# Prevent Xcodebuild from testing the non-existent i386 simulator if armv7 is specified without i386
|
18
|
+
command += %w(ARCHS=x86_64)
|
19
|
+
end
|
20
|
+
if @only_x64 && !(command.include? 'ARCHS=x86_64')
|
21
|
+
command += %w(ARCHS=x86_64)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
when :watchos
|
25
|
+
command += %w(CODE_SIGN_IDENTITY=- -sdk watchsimulator)
|
26
|
+
command += Fourflusher::SimControl.new.destination(:oldest, 'watchOS', deployment_target)
|
27
|
+
when :tvos
|
28
|
+
command += %w(CODE_SIGN_IDENTITY=- -sdk appletvsimulator)
|
29
|
+
command += Fourflusher::SimControl.new.destination(:oldest, 'tvOS', deployment_target)
|
30
|
+
end
|
31
|
+
|
32
|
+
if analyze
|
33
|
+
command += %w(CLANG_ANALYZER_OUTPUT=html CLANG_ANALYZER_OUTPUT_DIR=analyzer)
|
34
|
+
end
|
35
|
+
|
36
|
+
begin
|
37
|
+
_xcodebuild(command, true)
|
38
|
+
rescue => e
|
39
|
+
message = 'Returned an unsuccessful exit code.'
|
40
|
+
message += ' You can use `--verbose` for more information.' unless config.verbose?
|
41
|
+
error('xcodebuild', message)
|
42
|
+
e.message
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
class Command
|
49
|
+
class Lib < Command
|
50
|
+
class Lint < Lib
|
51
|
+
def self.options
|
52
|
+
[
|
53
|
+
['--quick', 'Lint skips checks that would require to download and build the spec'],
|
54
|
+
['--allow-warnings', 'Lint validates even if warnings are present'],
|
55
|
+
['--subspec=NAME', 'Lint validates only the given subspec'],
|
56
|
+
['--no-subspecs', 'Lint skips validation of subspecs'],
|
57
|
+
['--no-clean', 'Lint leaves the build directory intact for inspection'],
|
58
|
+
['--fail-fast', 'Lint stops on the first failing platform or subspec'],
|
59
|
+
['', 'Lint uses static libraries to install the spec'],
|
60
|
+
['--use-modular-headers', 'Lint uses modular headers during installation'],
|
61
|
+
["--sources=#{Pod::TrunkSource::TRUNK_REPO_URL}", 'The sources from which to pull dependent pods ' \
|
62
|
+
"(defaults to #{Pod::TrunkSource::TRUNK_REPO_URL}). Multiple sources must be comma-delimited"],
|
63
|
+
['--platforms=ios,macos', 'Lint against specific platforms (defaults to all platforms supported by the ' \
|
64
|
+
'podspec). Multiple platforms must be comma-delimited'],
|
65
|
+
['--private', 'Lint skips checks that apply only to public specs'],
|
66
|
+
['--swift-version=VERSION', 'The `SWIFT_VERSION` that should be used to lint the spec. ' \
|
67
|
+
'This takes precedence over the Swift versions specified by the spec or a `.swift-version` file'],
|
68
|
+
['--include-podspecs=**/*.podspec', 'Additional ancillary podspecs which are used for linting via :path'],
|
69
|
+
['--external-podspecs=**/*.podspec', 'Additional ancillary podspecs which are used for linting '\
|
70
|
+
'via :podspec. If there are --include-podspecs, then these are removed from them'],
|
71
|
+
['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
|
72
|
+
['--skip-tests', 'Lint skips building and running tests during validation'],
|
73
|
+
['--analyze', 'Validate with the Xcode Static Analysis tool'],
|
74
|
+
['--onlyx64', 'Lint uses only x86-64 iphonesimulator'],
|
75
|
+
].concat(super)
|
76
|
+
end
|
77
|
+
|
78
|
+
def initialize(argv)
|
79
|
+
@quick = argv.flag?('quick')
|
80
|
+
@allow_warnings = argv.flag?('allow-warnings')
|
81
|
+
@clean = argv.flag?('clean', true)
|
82
|
+
@fail_fast = argv.flag?('fail-fast', false)
|
83
|
+
@subspecs = argv.flag?('subspecs', true)
|
84
|
+
@only_subspec = argv.option('subspec')
|
85
|
+
@use_frameworks = !argv.flag?('use-libraries')
|
86
|
+
@use_modular_headers = argv.flag?('use-modular-headers')
|
87
|
+
@source_urls = argv.option('sources', Pod::TrunkSource::TRUNK_REPO_URL).split(',')
|
88
|
+
@platforms = argv.option('platforms', '').split(',')
|
89
|
+
@private = argv.flag?('private', false)
|
90
|
+
@swift_version = argv.option('swift-version', nil)
|
91
|
+
@include_podspecs = argv.option('include-podspecs', nil)
|
92
|
+
@external_podspecs = argv.option('external-podspecs', nil)
|
93
|
+
@skip_import_validation = argv.flag?('skip-import-validation', false)
|
94
|
+
@skip_tests = argv.flag?('skip-tests', false)
|
95
|
+
@analyze = argv.flag?('analyze', false)
|
96
|
+
@podspecs_paths = argv.arguments!
|
97
|
+
@only_x64 = argv.flag?('onlyx64', false)
|
98
|
+
super
|
99
|
+
end
|
100
|
+
|
101
|
+
def run
|
102
|
+
UI.puts
|
103
|
+
podspecs_to_lint.each do |podspec|
|
104
|
+
validator = Validator.new(podspec, @source_urls, @platforms)
|
105
|
+
validator.local = true
|
106
|
+
validator.quick = @quick
|
107
|
+
validator.no_clean = !@clean
|
108
|
+
validator.fail_fast = @fail_fast
|
109
|
+
validator.allow_warnings = @allow_warnings
|
110
|
+
validator.no_subspecs = !@subspecs || @only_subspec
|
111
|
+
validator.only_subspec = @only_subspec
|
112
|
+
validator.use_frameworks = @use_frameworks
|
113
|
+
validator.use_modular_headers = @use_modular_headers
|
114
|
+
validator.ignore_public_only_results = @private
|
115
|
+
validator.swift_version = @swift_version
|
116
|
+
validator.skip_import_validation = @skip_import_validation
|
117
|
+
validator.skip_tests = @skip_tests
|
118
|
+
validator.analyze = @analyze
|
119
|
+
validator.include_podspecs = @include_podspecs
|
120
|
+
validator.external_podspecs = @external_podspecs
|
121
|
+
validator.only_x64 = @only_x64
|
122
|
+
validator.validate
|
123
|
+
|
124
|
+
unless @clean
|
125
|
+
UI.puts "Pods workspace available at `#{validator.validation_dir}/App.xcworkspace` for inspection."
|
126
|
+
UI.puts
|
127
|
+
end
|
128
|
+
if validator.validated?
|
129
|
+
UI.puts "#{validator.spec.name} passed validation.".green
|
130
|
+
else
|
131
|
+
spec_name = podspec
|
132
|
+
spec_name = validator.spec.name if validator.spec
|
133
|
+
message = "#{spec_name} did not pass validation, due to #{validator.failure_reason}."
|
134
|
+
|
135
|
+
if @clean
|
136
|
+
message << "\nYou can use the `--no-clean` option to inspect " \
|
137
|
+
'any issue.'
|
138
|
+
end
|
139
|
+
raise Informative, message
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
class Command
|
148
|
+
class Spec < Command
|
149
|
+
class Lint < Spec
|
150
|
+
def self.options
|
151
|
+
[
|
152
|
+
['--quick', 'Lint skips checks that would require to download and build the spec'],
|
153
|
+
['--allow-warnings', 'Lint validates even if warnings are present'],
|
154
|
+
['--subspec=NAME', 'Lint validates only the given subspec'],
|
155
|
+
['--no-subspecs', 'Lint skips validation of subspecs'],
|
156
|
+
['--no-clean', 'Lint leaves the build directory intact for inspection'],
|
157
|
+
['--fail-fast', 'Lint stops on the first failing platform or subspec'],
|
158
|
+
['--use-libraries', 'Lint uses static libraries to install the spec'],
|
159
|
+
['--use-modular-headers', 'Lint uses modular headers during installation'],
|
160
|
+
["--sources=#{Pod::TrunkSource::TRUNK_REPO_URL}", 'The sources from which to pull dependent pods ' \
|
161
|
+
"(defaults to #{Pod::TrunkSource::TRUNK_REPO_URL}). Multiple sources must be comma-delimited"],
|
162
|
+
['--platforms=ios,macos', 'Lint against specific platforms (defaults to all platforms supported by the ' \
|
163
|
+
'podspec). Multiple platforms must be comma-delimited'],
|
164
|
+
['--private', 'Lint skips checks that apply only to public specs'],
|
165
|
+
['--swift-version=VERSION', 'The `SWIFT_VERSION` that should be used to lint the spec. ' \
|
166
|
+
'This takes precedence over the Swift versions specified by the spec or a `.swift-version` file'],
|
167
|
+
['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
|
168
|
+
['--skip-tests', 'Lint skips building and running tests during validation'],
|
169
|
+
['--analyze', 'Validate with the Xcode Static Analysis tool'],
|
170
|
+
['--onlyx64', 'Lint uses only x86-64 iphonesimulator'],
|
171
|
+
].concat(super)
|
172
|
+
end
|
173
|
+
|
174
|
+
def initialize(argv)
|
175
|
+
@quick = argv.flag?('quick')
|
176
|
+
@allow_warnings = argv.flag?('allow-warnings')
|
177
|
+
@clean = argv.flag?('clean', true)
|
178
|
+
@fail_fast = argv.flag?('fail-fast', false)
|
179
|
+
@subspecs = argv.flag?('subspecs', true)
|
180
|
+
@only_subspec = argv.option('subspec')
|
181
|
+
@use_frameworks = !argv.flag?('use-libraries')
|
182
|
+
@use_modular_headers = argv.flag?('use-modular-headers')
|
183
|
+
@source_urls = argv.option('sources', Pod::TrunkSource::TRUNK_REPO_URL).split(',')
|
184
|
+
@platforms = argv.option('platforms', '').split(',')
|
185
|
+
@private = argv.flag?('private', false)
|
186
|
+
@swift_version = argv.option('swift-version', nil)
|
187
|
+
@skip_import_validation = argv.flag?('skip-import-validation', false)
|
188
|
+
@skip_tests = argv.flag?('skip-tests', false)
|
189
|
+
@analyze = argv.flag?('analyze', false)
|
190
|
+
@podspecs_paths = argv.arguments!
|
191
|
+
@only_x64 = argv.flag?('onlyx64', false)
|
192
|
+
super
|
193
|
+
end
|
194
|
+
|
195
|
+
def run
|
196
|
+
UI.puts
|
197
|
+
failure_reasons = []
|
198
|
+
podspecs_to_lint.each do |podspec|
|
199
|
+
validator = Validator.new(podspec, @source_urls, @platforms)
|
200
|
+
validator.quick = @quick
|
201
|
+
validator.no_clean = !@clean
|
202
|
+
validator.fail_fast = @fail_fast
|
203
|
+
validator.allow_warnings = @allow_warnings
|
204
|
+
validator.no_subspecs = !@subspecs || @only_subspec
|
205
|
+
validator.only_subspec = @only_subspec
|
206
|
+
validator.use_frameworks = @use_frameworks
|
207
|
+
validator.use_modular_headers = @use_modular_headers
|
208
|
+
validator.ignore_public_only_results = @private
|
209
|
+
validator.swift_version = @swift_version
|
210
|
+
validator.skip_import_validation = @skip_import_validation
|
211
|
+
validator.skip_tests = @skip_tests
|
212
|
+
validator.analyze = @analyze
|
213
|
+
validator.only_x64 = @only_x64
|
214
|
+
validator.validate
|
215
|
+
failure_reasons << validator.failure_reason
|
216
|
+
|
217
|
+
unless @clean
|
218
|
+
UI.puts "Pods workspace available at `#{validator.validation_dir}/App.xcworkspace` for inspection."
|
219
|
+
UI.puts
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
count = podspecs_to_lint.count
|
224
|
+
UI.puts "Analyzed #{count} #{'podspec'.pluralize(count)}.\n\n"
|
225
|
+
|
226
|
+
failure_reasons.compact!
|
227
|
+
if failure_reasons.empty?
|
228
|
+
lint_passed_message = count == 1 ? "#{podspecs_to_lint.first.basename} passed validation." : 'All the specs passed validation.'
|
229
|
+
UI.puts lint_passed_message.green << "\n\n"
|
230
|
+
else
|
231
|
+
raise Informative, if count == 1
|
232
|
+
"The spec did not pass validation, due to #{failure_reasons.first}."
|
233
|
+
else
|
234
|
+
"#{failure_reasons.count} out of #{count} specs failed validation."
|
235
|
+
end
|
236
|
+
end
|
237
|
+
podspecs_tmp_dir.rmtree if podspecs_tmp_dir.exist?
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
class Command
|
244
|
+
class Repo < Command
|
245
|
+
class Push < Repo
|
246
|
+
def self.options
|
247
|
+
[
|
248
|
+
['--allow-warnings', 'Allows pushing even if there are warnings'],
|
249
|
+
['--use-libraries', 'Linter uses static libraries to install the spec'],
|
250
|
+
['--use-modular-headers', 'Lint uses modular headers during installation'],
|
251
|
+
["--sources=#{Pod::TrunkSource::TRUNK_REPO_URL}", 'The sources from which to pull dependent pods ' \
|
252
|
+
'(defaults to all available repos). Multiple sources must be comma-delimited'],
|
253
|
+
['--local-only', 'Does not perform the step of pushing REPO to its remote'],
|
254
|
+
['--no-private', 'Lint includes checks that apply only to public repos'],
|
255
|
+
['--skip-import-validation', 'Lint skips validating that the pod can be imported'],
|
256
|
+
['--skip-tests', 'Lint skips building and running tests during validation'],
|
257
|
+
['--commit-message="Fix bug in pod"', 'Add custom commit message. Opens default editor if no commit ' \
|
258
|
+
'message is specified'],
|
259
|
+
['--use-json', 'Convert the podspec to JSON before pushing it to the repo'],
|
260
|
+
['--swift-version=VERSION', 'The `SWIFT_VERSION` that should be used when linting the spec. ' \
|
261
|
+
'This takes precedence over the Swift versions specified by the spec or a `.swift-version` file'],
|
262
|
+
['--no-overwrite', 'Disallow pushing that would overwrite an existing spec'],
|
263
|
+
['--onlyx64', 'Lint uses only x86-64 iphonesimulator'],
|
264
|
+
].concat(super)
|
265
|
+
end
|
266
|
+
|
267
|
+
def initialize(argv)
|
268
|
+
@allow_warnings = argv.flag?('allow-warnings')
|
269
|
+
@local_only = argv.flag?('local-only')
|
270
|
+
@repo = argv.shift_argument
|
271
|
+
@source = source_for_repo
|
272
|
+
@source_urls = argv.option('sources', config.sources_manager.all.map(&:url).join(',')).split(',')
|
273
|
+
@podspec = argv.shift_argument
|
274
|
+
@use_frameworks = !argv.flag?('use-libraries')
|
275
|
+
@use_modular_headers = argv.flag?('use-modular-headers', false)
|
276
|
+
@private = argv.flag?('private', true)
|
277
|
+
@message = argv.option('commit-message')
|
278
|
+
@commit_message = argv.flag?('commit-message', false)
|
279
|
+
@use_json = argv.flag?('use-json')
|
280
|
+
@swift_version = argv.option('swift-version', nil)
|
281
|
+
@skip_import_validation = argv.flag?('skip-import-validation', false)
|
282
|
+
@skip_tests = argv.flag?('skip-tests', false)
|
283
|
+
@allow_overwrite = argv.flag?('overwrite', true)
|
284
|
+
@only_x64 = argv.flag?('onlyx64', false)
|
285
|
+
super
|
286
|
+
end
|
287
|
+
|
288
|
+
def validate_podspec_files
|
289
|
+
UI.puts "\nValidating #{'spec'.pluralize(count)}".yellow
|
290
|
+
podspec_files.each do |podspec|
|
291
|
+
validator = Validator.new(podspec, @source_urls)
|
292
|
+
validator.allow_warnings = @allow_warnings
|
293
|
+
validator.use_frameworks = @use_frameworks
|
294
|
+
validator.use_modular_headers = @use_modular_headers
|
295
|
+
validator.ignore_public_only_results = @private
|
296
|
+
validator.swift_version = @swift_version
|
297
|
+
validator.skip_import_validation = @skip_import_validation
|
298
|
+
validator.skip_tests = @skip_tests
|
299
|
+
validator.only_x64 = @only_x64
|
300
|
+
begin
|
301
|
+
validator.validate
|
302
|
+
rescue => e
|
303
|
+
raise Informative, "The `#{podspec}` specification does not validate." \
|
304
|
+
"\n\n#{e.message}"
|
305
|
+
end
|
306
|
+
raise Informative, "The `#{podspec}` specification does not validate." unless validator.validated?
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
311
|
+
end
|
312
|
+
|
313
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-lint-onlyx64/command'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
ROOT = Pathname.new(File.expand_path('../../', __FILE__))
|
3
|
+
$:.unshift((ROOT + 'lib').to_s)
|
4
|
+
$:.unshift((ROOT + 'spec').to_s)
|
5
|
+
|
6
|
+
require 'bundler/setup'
|
7
|
+
require 'bacon'
|
8
|
+
require 'mocha-on-bacon'
|
9
|
+
require 'pretty_bacon'
|
10
|
+
require 'pathname'
|
11
|
+
require 'cocoapods'
|
12
|
+
|
13
|
+
Mocha::Configuration.prevent(:stubbing_non_existent_method)
|
14
|
+
|
15
|
+
require 'cocoapods_plugin'
|
16
|
+
|
17
|
+
#-----------------------------------------------------------------------------#
|
18
|
+
|
19
|
+
module Pod
|
20
|
+
|
21
|
+
# Disable the wrapping so the output is deterministic in the tests.
|
22
|
+
#
|
23
|
+
UI.disable_wrap = true
|
24
|
+
|
25
|
+
# Redirects the messages to an internal store.
|
26
|
+
#
|
27
|
+
module UI
|
28
|
+
@output = ''
|
29
|
+
@warnings = ''
|
30
|
+
|
31
|
+
class << self
|
32
|
+
attr_accessor :output
|
33
|
+
attr_accessor :warnings
|
34
|
+
|
35
|
+
def puts(message = '')
|
36
|
+
@output << "#{message}\n"
|
37
|
+
end
|
38
|
+
|
39
|
+
def warn(message = '', actions = [])
|
40
|
+
@warnings << "#{message}\n"
|
41
|
+
end
|
42
|
+
|
43
|
+
def print(message)
|
44
|
+
@output << message
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#-----------------------------------------------------------------------------#
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-lint-onlyx64
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- nakahira
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-10-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
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: rake
|
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: cocoapods
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.9.3
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.9.3
|
55
|
+
description: A short description of cocoapods-lint-onlyx64.
|
56
|
+
email:
|
57
|
+
- 1021057927@qq.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- Gemfile.lock
|
65
|
+
- LICENSE.txt
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- cocoapods-lint-onlyx64.gemspec
|
69
|
+
- lib/cocoapods-lint-onlyx64.rb
|
70
|
+
- lib/cocoapods-lint-onlyx64/command.rb
|
71
|
+
- lib/cocoapods-lint-onlyx64/command/onlyx64.rb
|
72
|
+
- lib/cocoapods-lint-onlyx64/gem_version.rb
|
73
|
+
- lib/cocoapods_plugin.rb
|
74
|
+
- spec/command/onlyx64_spec.rb
|
75
|
+
- spec/spec_helper.rb
|
76
|
+
homepage: https://github.com/xuzhongping/cocoapods-lint-onlyx64
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata: {}
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubygems_version: 3.1.2
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: A longer description of cocoapods-lint-onlyx64.
|
99
|
+
test_files:
|
100
|
+
- spec/command/onlyx64_spec.rb
|
101
|
+
- spec/spec_helper.rb
|