cocoapods-tdfire-binary 1.0.9 → 1.0.10
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/cocoapods-tdfire-binary.gemspec +0 -1
- data/lib/cocoapods-tdfire-binary/binary_specification_refactor.rb +17 -6
- data/lib/cocoapods-tdfire-binary/binary_url_manager.rb +1 -1
- data/lib/cocoapods-tdfire-binary/command/assemble.rb +28 -4
- data/lib/cocoapods-tdfire-binary/gem_version.rb +1 -1
- data/lib/cocoapods-tdfire-binary/podfile_dsl.rb +1 -1
- data/spec/command/specification_spec.rb +102 -0
- data/spec/fixtures/boy.podspec +13 -0
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f18d003702464d5348466610a3bf47a5b8b7f051
|
4
|
+
data.tar.gz: aa789bc5aa73e6b9daf31b4bd2f2a3fd1ac0141b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58d963064f599b58aebdf327526b9b7d2ce21fd9b1ef4fd1fe4e6c3b6016b5d1aceaf93bfa7a928f4bf7805e5b59900fc1a6597567cfb4f54c0f7537d8b0101b
|
7
|
+
data.tar.gz: 63b57e9f55de5e684b669b573722cb4d8650728a838fa1bfccccfda3e8fc1ca530983b7bcbe8e9c6a8a9dd61ae518d37581ba3f4b83d9f30095fe9d5a3ac5b2d
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -8,7 +8,6 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = CocoapodsTdfireBinary::VERSION
|
9
9
|
spec.authors = ['tripleCC']
|
10
10
|
spec.email = ['triplec.linux@gmail.com']
|
11
|
-
spec.description = %q{cocoapods-tdfire-binary is a plugin which helps developer switching there project dependency between source and binary.}
|
12
11
|
spec.summary = %q{cocoapods-tdfire-binary is a plugin which helps developer switching there project dependency between source and binary.}
|
13
12
|
spec.homepage = 'https://github.com/tripleCC/cocoapods-tdfire-binary'
|
14
13
|
spec.license = 'MIT'
|
@@ -95,8 +95,17 @@ module Pod
|
|
95
95
|
|
96
96
|
# 组件 frameworks 的依赖
|
97
97
|
target_spec.vendored_frameworks = "#{target_spec.root.name}.framework"
|
98
|
-
|
99
|
-
|
98
|
+
# 如果不加这一句,会提示找不到 bundle。测试时需要 shift + cmd + k 清除 production
|
99
|
+
#
|
100
|
+
# static framework 不像 dynamic framework ,后者在生成 production 后,会有一个专门的 Frameworks 文件夹,其内部的结构和打包前是一致的, bundle 也会在 .framework 文件中
|
101
|
+
# 而 static framework 的可执行文件部分,会被合并到 App 的可执行文件中, bundle 按逻辑会放到 main bundle 中,
|
102
|
+
# 但是 CocoaPods 并不会帮 vendored_frameworks 中的 static framework 做 bundle 的拷贝工作,
|
103
|
+
# 所以这里需要暴露 static framework 中的 bundle ,明确让 CocoaPods 拷贝 bundle 到 main bundle,
|
104
|
+
# 可以查看 高德地图 和 友盟等 framework ,都已这种方式处理
|
105
|
+
#
|
106
|
+
target_spec.resources = ["#{target_spec.root.name}.framework/Resources/*.bundle", "#{target_spec.root.name}.framework/Versions/A/Resources/*.bundle"]
|
107
|
+
# target_spec.source_files = ["#{target_spec.root.name}.framework/Headers/*", "#{target_spec.root.name}.framework/Versions/A/Headers/*"]
|
108
|
+
# target_spec.public_header_files = ["#{target_spec.root.name}.framework/Headers/*", "#{target_spec.root.name}.framework/Versions/A/Headers/*"]
|
100
109
|
|
101
110
|
available_platforms(spec).each do |platform|
|
102
111
|
Pod::UI.section("Tdfire: copying configuration for platform #{platform}") do
|
@@ -129,11 +138,10 @@ module Pod
|
|
129
138
|
#--------------------------------------------------------------------#
|
130
139
|
# spec 是源码依赖时的配置
|
131
140
|
def set_preserve_paths(spec)
|
132
|
-
# 这里一般不会和上面那个方法一样,不同平台的配置还不一致,所以就不用 consumer 了
|
133
|
-
# 源码、资源文件
|
134
|
-
#
|
135
141
|
available_platforms(spec).each do |platform|
|
136
142
|
Pod::UI.section("Tdfire: set preserve paths for platform #{platform}") do
|
143
|
+
# 源码、资源文件
|
144
|
+
#
|
137
145
|
source_files = spec.tdfire_recursive_value('source_files', platform)
|
138
146
|
resources = spec.tdfire_recursive_value('resources', platform)
|
139
147
|
resource_bundles = spec.tdfire_recursive_value('resource_bundles', platform)
|
@@ -149,7 +157,7 @@ module Pod
|
|
149
157
|
preserve_paths += target_preserve_paths unless target_preserve_paths.empty?
|
150
158
|
|
151
159
|
target_platform = target_spec.send(platform.to_sym)
|
152
|
-
target_platform.
|
160
|
+
target_platform.preserve_paths = preserve_paths.uniq
|
153
161
|
|
154
162
|
Pod::UI.message "Tdfire: preserve paths for #{platform}: #{preserve_paths.join(', ')}"
|
155
163
|
end
|
@@ -159,6 +167,9 @@ module Pod
|
|
159
167
|
#--------------------------------------------------------------------#
|
160
168
|
|
161
169
|
def set_use_static_framework
|
170
|
+
# 1.4.0 版本生效
|
171
|
+
# 使用 use_frameworks! 后,生成静态 Framework
|
172
|
+
#
|
162
173
|
target_spec.static_framework = true if target_spec.respond_to?('static_framework')
|
163
174
|
end
|
164
175
|
|
@@ -20,10 +20,34 @@ module Pod
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def run
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
# 每条命令要重开一个上下文
|
24
|
+
|
25
|
+
run_commands [
|
26
|
+
'pod binary package --clean',
|
27
|
+
'pod binary lint',
|
28
|
+
'pod binary push',
|
29
|
+
'pod binary publish'
|
30
|
+
]
|
31
|
+
#
|
32
|
+
# system 'pod binary package --clean'
|
33
|
+
# system 'pod binary lint'
|
34
|
+
# system 'pod binary push'
|
35
|
+
# system 'pod binary publish'
|
36
|
+
|
37
|
+
# the sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
|
38
|
+
# lint 和 publish 的时候,都会出现这个问题
|
39
|
+
#
|
40
|
+
# run_command Package, ['--clean']
|
41
|
+
# run_command Lint
|
42
|
+
# run_command Push
|
43
|
+
# run_command Publish
|
44
|
+
end
|
45
|
+
|
46
|
+
def run_commands(commands)
|
47
|
+
commands.each do |c|
|
48
|
+
system c
|
49
|
+
break if $?.exitstatus != 0
|
50
|
+
end
|
27
51
|
end
|
28
52
|
|
29
53
|
def run_command(command_class, argv = [])
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
describe Specification do
|
5
|
+
it 'get recursive value' do
|
6
|
+
spec = Specification.new do |s|
|
7
|
+
s.framework = 'UIKit'
|
8
|
+
s.ios.framework = 'CoreGraphics'
|
9
|
+
|
10
|
+
s.subspec 'boy' do |ss|
|
11
|
+
ss.framework = 'Accounts'
|
12
|
+
ss.ios.framework = 'ARKit'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
spec.tdfire_recursive_value('frameworks', :ios).should == ['UIKit', 'CoreGraphics', 'Accounts', 'ARKit']
|
16
|
+
spec.tdfire_recursive_value('frameworks', :osx).should == ['UIKit', 'Accounts']
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe SpecificationRefactor = Tdfire::BinarySpecificationRefactor do
|
21
|
+
before do
|
22
|
+
@boy_spec = Specification::new(nil, 'Preson') do |s|
|
23
|
+
s.public_header_files = 'boy.h'
|
24
|
+
s.source_files = 'boy.{h,m}'
|
25
|
+
s.resources = 'boy.png'
|
26
|
+
s.resource_bundles = {:boy => 'boy_next_door.png' }
|
27
|
+
|
28
|
+
s.frameworks = 'UIKit'
|
29
|
+
s.dependency 'ReactiveX'
|
30
|
+
end
|
31
|
+
|
32
|
+
@girl_spec = Specification::new(nil, 'Preson') do |s|
|
33
|
+
s.public_header_files = 'boy.h'
|
34
|
+
s.source_files = 'boy.{h,m}'
|
35
|
+
s.resources = 'boy.png'
|
36
|
+
s.resource_bundles = {:boy => 'boy_next_door.png' }
|
37
|
+
|
38
|
+
s.frameworks = 'UIKit'
|
39
|
+
s.dependency 'ReactiveX'
|
40
|
+
|
41
|
+
s.subspec 'Core' do |ss|
|
42
|
+
ss.public_header_files = 'Core/Core.h'
|
43
|
+
ss.source_files = 'Core.{h,m}'
|
44
|
+
ss.resources = 'Core.png'
|
45
|
+
ss.resource_bundles = {:Core => 'core_next_door.png' }
|
46
|
+
|
47
|
+
ss.frameworks = 'CoreGraphics'
|
48
|
+
ss.dependency 'AFNetworking'
|
49
|
+
end
|
50
|
+
|
51
|
+
s.subspec 'Car' do |ss|
|
52
|
+
ss.public_header_files = 'Car/Car.h'
|
53
|
+
ss.source_files = 'Car.{h,m}'
|
54
|
+
ss.resources = 'Car.png'
|
55
|
+
ss.resource_bundles = {:Car => 'car_next_door.png' }
|
56
|
+
|
57
|
+
ss.frameworks = 'Accounts'
|
58
|
+
ss.dependency 'SDWebImage'
|
59
|
+
ss.dependency 'Preson/Core'
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
@empty_spec = Specification::new(nil, 'Preson')
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'configure binary' do
|
67
|
+
refactor = SpecificationRefactor.new(@empty_spec)
|
68
|
+
refactor.configure_binary(@boy_spec)
|
69
|
+
|
70
|
+
ios_consumer = @empty_spec.consumer(:ios)
|
71
|
+
ios_consumer.frameworks.should == ['UIKit']
|
72
|
+
ios_consumer.dependencies.map(&:name).should == ['ReactiveX']
|
73
|
+
ios_consumer.vendored_frameworks.should == ['Preson.framework']
|
74
|
+
end
|
75
|
+
|
76
|
+
it 'configure binary default subspec' do
|
77
|
+
refactor = SpecificationRefactor.new(@empty_spec)
|
78
|
+
refactor.configure_binary_default_subspec(@girl_spec)
|
79
|
+
|
80
|
+
(@empty_spec.subspecs.map(&:name) - ['Preson/TdfireBinary']).should == @girl_spec.subspecs.map(&:name)
|
81
|
+
ios_consumer = @empty_spec.subspecs.select { |s| s.name == 'Preson/TdfireBinary' }.first.consumer(:ios)
|
82
|
+
ios_consumer.frameworks.should == ['UIKit', 'CoreGraphics', 'Accounts']
|
83
|
+
ios_consumer.dependencies.map(&:name).should == ['ReactiveX', 'AFNetworking', 'SDWebImage']
|
84
|
+
ios_consumer.vendored_frameworks.should == ['Preson.framework']
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'set preserve paths' do
|
88
|
+
refactor = SpecificationRefactor.new(@empty_spec)
|
89
|
+
refactor.set_preserve_paths(@boy_spec)
|
90
|
+
|
91
|
+
preserve_paths = ['Preson.framework']
|
92
|
+
preserve_paths += ['boy.{h,m}', 'boy.png', 'boy_next_door.png']
|
93
|
+
@empty_spec.consumer(:ios).preserve_paths.sort.should == preserve_paths.sort
|
94
|
+
|
95
|
+
refactor = SpecificationRefactor.new(@empty_spec)
|
96
|
+
refactor.set_preserve_paths(@girl_spec)
|
97
|
+
preserve_paths += ['Core.{h,m}', 'Core.png', 'core_next_door.png']
|
98
|
+
preserve_paths += ['Car.{h,m}', 'Car.png', 'car_next_door.png']
|
99
|
+
@empty_spec.consumer(:ios).preserve_paths.sort.should == preserve_paths.sort
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = "boy"
|
3
|
+
s.version = "1.0.0"
|
4
|
+
s.author = { "boy" => "boy.@next.door" }
|
5
|
+
s.summary = "🙈🙉🙊"
|
6
|
+
s.description = "boy next door"
|
7
|
+
s.homepage = "http://httpbin.org/html"
|
8
|
+
s.source = { :git => "http://boy.next/door.git", :tag => s.version.to_s }
|
9
|
+
s.license = 'MIT'
|
10
|
+
|
11
|
+
s.public_header_files = 'boy.h'
|
12
|
+
s.source_files = 'boy.{h,m}'
|
13
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-tdfire-binary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tripleCC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,8 +66,7 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.5.0
|
69
|
-
description:
|
70
|
-
project dependency between source and binary.
|
69
|
+
description:
|
71
70
|
email:
|
72
71
|
- triplec.linux@gmail.com
|
73
72
|
executables: []
|
@@ -102,6 +101,8 @@ files:
|
|
102
101
|
- lib/cocoapods-tdfire-binary/specification_dsl.rb
|
103
102
|
- lib/cocoapods_plugin.rb
|
104
103
|
- spec/command/binary_spec.rb
|
104
|
+
- spec/command/specification_spec.rb
|
105
|
+
- spec/fixtures/boy.podspec
|
105
106
|
- spec/spec_helper.rb
|
106
107
|
homepage: https://github.com/tripleCC/cocoapods-tdfire-binary
|
107
108
|
licenses:
|
@@ -130,4 +131,6 @@ summary: cocoapods-tdfire-binary is a plugin which helps developer switching the
|
|
130
131
|
project dependency between source and binary.
|
131
132
|
test_files:
|
132
133
|
- spec/command/binary_spec.rb
|
134
|
+
- spec/command/specification_spec.rb
|
135
|
+
- spec/fixtures/boy.podspec
|
133
136
|
- spec/spec_helper.rb
|