cocoapods-swift-binary-source-resolver 0.0.1
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 +7 -0
- data/.gitignore +3 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +17 -0
- data/Rakefile +13 -0
- data/cocoapods-swift-binary-source-resolver.gemspec +23 -0
- data/lib/cocoapods-swift-binary-source-resolver.rb +1 -0
- data/lib/cocoapods-swift-binary-source-resolver/gem_version.rb +3 -0
- data/lib/cocoapods-swift-binary-source-resolver/main.rb +13 -0
- data/lib/cocoapods-swift-binary-source-resolver/patch.rb +51 -0
- data/lib/cocoapods_plugin.rb +1 -0
- data/spec/command/resolver_spec.rb +12 -0
- data/spec/spec_helper.rb +50 -0
- metadata +86 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2e0716b3ac02ae0cece7b60ab1982bcf8dcf92a1b7ade9097ab12d629adfe888
|
4
|
+
data.tar.gz: 8cd5f90126c6031c0bf26afe92a4d61dbcdda614480856d4cb61727ea641a5a1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f7247fe6874fd5d496deb201bb796a33036af286e566088326a6f2a39b0b681ec0724fc1cbac25bdb8ba09592a6a3c9908e7cea65530429d74c362d7472be889
|
7
|
+
data.tar.gz: 874430900fc851456b304546d31d72a7d8f6eb246f34e94c8e3ae557fea176600d1a400f66ea610aad24ccb5515257321713a339890220858e16670dc367c2c9
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2019 Gao <gaoji@bytedance.com>
|
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
|
+
# cocoapods-swift-binary-source-resolver
|
2
|
+
|
3
|
+
在 swift 多编译器版本里,会在 spec 里进行 if 判断。在没有对应的版本的时候,会
|
4
|
+
返回异常。这个在日常开发里,会正常运行,因为显式写的。但在平台打包的时候,没有二进制
|
5
|
+
版本不应该阻塞进行,而是用源代码版来代替。
|
6
|
+
|
7
|
+
这个插件就是解决了这个问题。如果 spec 里返回异常,则使用次之的版本/源再尝试。
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
$ gem install cocoapods-swift-binary-source-resolver
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
In pod file:
|
16
|
+
|
17
|
+
use_source_if_no_valid_binary!
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'cocoapods-swift-binary-source-resolver/gem_version.rb'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'cocoapods-swift-binary-source-resolver'
|
8
|
+
spec.version = CocoapodsSwiftBinarySourceResolver::VERSION
|
9
|
+
spec.authors = ['Gao']
|
10
|
+
spec.email = ['gaoji@bytedance.com']
|
11
|
+
spec.description = %q{A short description of cocoapods-swift-binary-source-resolver.}
|
12
|
+
spec.summary = %q{A longer description of cocoapods-swift-binary-source-resolver.}
|
13
|
+
spec.homepage = 'https://github.com/EXAMPLE/cocoapods-swift-binary-source-resolver'
|
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', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-swift-binary-source-resolver/gem_version'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
|
2
|
+
# Specification::Set 这个类在 Pod::Source::Aggregate 的 search 方法里调用了
|
3
|
+
|
4
|
+
module Pod
|
5
|
+
class Specification
|
6
|
+
# A Specification::Set is responsible of handling all the specifications of
|
7
|
+
# a Pod. This class stores the information of the dependencies that required
|
8
|
+
# a Pod in the resolution process.
|
9
|
+
#
|
10
|
+
# @note The order in which the sets are provided is used to select a
|
11
|
+
# specification if multiple are available for a given version.
|
12
|
+
#
|
13
|
+
# @note The set class is not and should be not aware of the backing store
|
14
|
+
# of a Source.
|
15
|
+
#
|
16
|
+
class Set
|
17
|
+
|
18
|
+
# override original
|
19
|
+
def specification
|
20
|
+
unless highest_version_spec_path
|
21
|
+
raise Informative, "Could not find the highest version for `#{name}`. "\
|
22
|
+
"This could be due to an empty #{name} directory in a local repository."
|
23
|
+
end
|
24
|
+
|
25
|
+
# 如果一个 source 不好用,就用另外的 source 试试
|
26
|
+
versions.each do |version|
|
27
|
+
paths = specification_paths_for_version(highest_version)
|
28
|
+
paths.each do |path|
|
29
|
+
begin
|
30
|
+
return Specification.from_file(path) # the real out
|
31
|
+
rescue => e
|
32
|
+
inner_info_exception = e
|
33
|
+
if e.kind_of? DSLError
|
34
|
+
inner_info_exception = e.underlying_exception
|
35
|
+
end
|
36
|
+
# @swift_binary_exception 是在二进制的 podfile 里设的
|
37
|
+
unless inner_info_exception.instance_variable_get(:@swift_binary_exception) == true
|
38
|
+
raise e
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
raise Informative, "Could not find the highest version for `#{name}`. "\
|
45
|
+
"This could be due to an empty #{name} directory in a local repository."
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'cocoapods-swift-binary-source-resolver/main'
|
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,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cocoapods-swift-binary-source-resolver
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gao
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-04 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: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
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
|
+
description: A short description of cocoapods-swift-binary-source-resolver.
|
42
|
+
email:
|
43
|
+
- gaoji@bytedance.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- cocoapods-swift-binary-source-resolver.gemspec
|
54
|
+
- lib/cocoapods-swift-binary-source-resolver.rb
|
55
|
+
- lib/cocoapods-swift-binary-source-resolver/gem_version.rb
|
56
|
+
- lib/cocoapods-swift-binary-source-resolver/main.rb
|
57
|
+
- lib/cocoapods-swift-binary-source-resolver/patch.rb
|
58
|
+
- lib/cocoapods_plugin.rb
|
59
|
+
- spec/command/resolver_spec.rb
|
60
|
+
- spec/spec_helper.rb
|
61
|
+
homepage: https://github.com/EXAMPLE/cocoapods-swift-binary-source-resolver
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
metadata: {}
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
requirements: []
|
80
|
+
rubygems_version: 3.0.3
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: A longer description of cocoapods-swift-binary-source-resolver.
|
84
|
+
test_files:
|
85
|
+
- spec/command/resolver_spec.rb
|
86
|
+
- spec/spec_helper.rb
|