cocoapods-xzpackager 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/.coveralls.yml +1 -0
- data/.gitignore +3 -0
- data/.rubocop-cocoapods.yml +71 -0
- data/.rubocop.yml +38 -0
- data/.travis.yml +9 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +121 -0
- data/LICENSE +22 -0
- data/README.md +42 -0
- data/Rakefile +12 -0
- data/TAGS +180 -0
- data/cocoapods-xzpackager.gemspec +22 -0
- data/lib/cocoapods-packager/builder.rb +335 -0
- data/lib/cocoapods-packager/framework.rb +75 -0
- data/lib/cocoapods-packager/mangle.rb +32 -0
- data/lib/cocoapods-packager/pod_utils.rb +244 -0
- data/lib/cocoapods-packager/spec_builder.rb +219 -0
- data/lib/cocoapods-packager/symbols.rb +42 -0
- data/lib/cocoapods-packager/user_interface/build_failed_report.rb +15 -0
- data/lib/cocoapods_plugin.rb +8 -0
- data/lib/cocoapods_xzpackager.rb +5 -0
- data/lib/pod/command/package.rb +226 -0
- data/scripts/lstconst.sh +9 -0
- data/scripts/lstsym.sh +8 -0
- data/spec/command/error_spec.rb +74 -0
- data/spec/command/package_spec.rb +359 -0
- data/spec/command/subspecs_spec.rb +30 -0
- data/spec/fixtures/Builder.podspec +25 -0
- data/spec/fixtures/CPDColors.podspec +19 -0
- data/spec/fixtures/FH.podspec +18 -0
- data/spec/fixtures/KFData.podspec +73 -0
- data/spec/fixtures/LibraryConsumerDemo/.gitignore +22 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.pbxproj +340 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/xcshareddata/xcschemes/LibraryConsumer.xcscheme +100 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.h +17 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.m +27 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/Info.plist +40 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/main.m +16 -0
- data/spec/fixtures/LibraryConsumerDemo/Podfile +5 -0
- data/spec/fixtures/LibraryDemo.podspec +14 -0
- data/spec/fixtures/NikeKit.podspec +19 -0
- data/spec/fixtures/OpenSans.podspec +18 -0
- data/spec/fixtures/PackagerTest/.gitignore +21 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/project.pbxproj +536 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/xcshareddata/xcschemes/PackagerTest.xcscheme +110 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcworkspace/contents.xcworkspacedata +1 -0
- data/spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.h +15 -0
- data/spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.m +49 -0
- data/spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/AppIcon.appiconset/Contents.json +23 -0
- data/spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/LaunchImage.launchimage/Contents.json +23 -0
- data/spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Info.plist +38 -0
- data/spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Prefix.pch +16 -0
- data/spec/fixtures/PackagerTest/PackagerTest/en.lproj/InfoPlist.strings +2 -0
- data/spec/fixtures/PackagerTest/PackagerTest/main.m +18 -0
- data/spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests-Info.plist +22 -0
- data/spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests.m +34 -0
- data/spec/fixtures/PackagerTest/PackagerTestTests/en.lproj/InfoPlist.strings +2 -0
- data/spec/fixtures/PackagerTest/Podfile +10 -0
- data/spec/fixtures/PackagerTest/Podfile.lock +32 -0
- data/spec/fixtures/Weakly.podspec +13 -0
- data/spec/fixtures/a.podspec +19 -0
- data/spec/fixtures/foo-bar.podspec +19 -0
- data/spec/fixtures/layer-client-messaging-schema.podspec +13 -0
- data/spec/integration/project_spec.rb +70 -0
- data/spec/pod/utils_spec.rb +58 -0
- data/spec/spec_helper.rb +50 -0
- data/spec/specification/builder_spec.rb +40 -0
- data/spec/specification/spec_builder_spec.rb +61 -0
- data/spec/user_interface/build_failed_report_spec.rb +11 -0
- metadata +225 -0
@@ -0,0 +1,244 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class Package < Command
|
4
|
+
private
|
5
|
+
|
6
|
+
def build_static_sandbox(dynamic)
|
7
|
+
static_sandbox_root = if dynamic
|
8
|
+
Pathname.new(config.sandbox_root + '/Static')
|
9
|
+
else
|
10
|
+
Pathname.new(config.sandbox_root)
|
11
|
+
end
|
12
|
+
Sandbox.new(static_sandbox_root)
|
13
|
+
end
|
14
|
+
|
15
|
+
def install_pod(platform_name, sandbox)
|
16
|
+
podfile = podfile_from_spec(
|
17
|
+
@path,
|
18
|
+
@spec.name,
|
19
|
+
platform_name,
|
20
|
+
@spec.deployment_target(platform_name),
|
21
|
+
@subspecs,
|
22
|
+
@spec_sources
|
23
|
+
)
|
24
|
+
|
25
|
+
static_installer = Installer.new(sandbox, podfile)
|
26
|
+
static_installer.install!
|
27
|
+
|
28
|
+
unless static_installer.nil?
|
29
|
+
static_installer.pods_project.targets.each do |target|
|
30
|
+
target.build_configurations.each do |config|
|
31
|
+
config.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
|
32
|
+
config.build_settings['GCC_GENERATE_DEBUGGING_SYMBOLS'] = 'NO'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
static_installer.pods_project.save
|
36
|
+
end
|
37
|
+
|
38
|
+
static_installer
|
39
|
+
end
|
40
|
+
|
41
|
+
def podfile_from_spec(path, spec_name, platform_name, deployment_target, subspecs, sources)
|
42
|
+
options = {}
|
43
|
+
if path
|
44
|
+
if @local
|
45
|
+
options[:path] = path
|
46
|
+
else
|
47
|
+
options[:podspec] = path
|
48
|
+
end
|
49
|
+
end
|
50
|
+
options[:subspecs] = subspecs if subspecs
|
51
|
+
Pod::Podfile.new do
|
52
|
+
sources.each { |s| source s }
|
53
|
+
platform(platform_name, deployment_target)
|
54
|
+
pod(spec_name, options)
|
55
|
+
|
56
|
+
install!('cocoapods',
|
57
|
+
:integrate_targets => false,
|
58
|
+
:deterministic_uuids => false)
|
59
|
+
|
60
|
+
target('packager') do
|
61
|
+
inherit! :complete
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def binary_only?(spec)
|
67
|
+
deps = spec.dependencies.map { |dep| spec_with_name(dep.name) }
|
68
|
+
[spec, *deps].each do |specification|
|
69
|
+
%w(vendored_frameworks vendored_libraries).each do |attrib|
|
70
|
+
if specification.attributes_hash[attrib]
|
71
|
+
return true
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
false
|
77
|
+
end
|
78
|
+
|
79
|
+
def spec_with_name(name)
|
80
|
+
return if name.nil?
|
81
|
+
|
82
|
+
set = Pod::Config.instance.sources_manager.search(Dependency.new(name))
|
83
|
+
return nil if set.nil?
|
84
|
+
|
85
|
+
set.specification.root
|
86
|
+
end
|
87
|
+
|
88
|
+
def spec_with_path(path)
|
89
|
+
return if path.nil?
|
90
|
+
path = Pathname.new(path)
|
91
|
+
path = Pathname.new(Dir.pwd).join(path) unless path.absolute?
|
92
|
+
return unless path.exist?
|
93
|
+
|
94
|
+
@path = path.expand_path
|
95
|
+
|
96
|
+
if @path.directory?
|
97
|
+
help! @path + ': is a directory.'
|
98
|
+
return
|
99
|
+
end
|
100
|
+
|
101
|
+
unless ['.podspec', '.json'].include? @path.extname
|
102
|
+
help! @path + ': is not a podspec.'
|
103
|
+
return
|
104
|
+
end
|
105
|
+
|
106
|
+
Specification.from_file(@path)
|
107
|
+
end
|
108
|
+
|
109
|
+
#----------------------
|
110
|
+
# Dynamic Project Setup
|
111
|
+
#----------------------
|
112
|
+
|
113
|
+
def build_dynamic_sandbox(_static_sandbox, _static_installer)
|
114
|
+
dynamic_sandbox_root = Pathname.new(config.sandbox_root + '/Dynamic')
|
115
|
+
dynamic_sandbox = Sandbox.new(dynamic_sandbox_root)
|
116
|
+
|
117
|
+
dynamic_sandbox
|
118
|
+
end
|
119
|
+
|
120
|
+
# @param [Pod::Sandbox] dynamic_sandbox
|
121
|
+
#
|
122
|
+
# @param [Pod::Sandbox] static_sandbox
|
123
|
+
#
|
124
|
+
# @param [Pod::Installer] static_installer
|
125
|
+
#
|
126
|
+
# @param [Pod::Platform] platform
|
127
|
+
#
|
128
|
+
def install_dynamic_pod(dynamic_sandbox, static_sandbox, static_installer, platform)
|
129
|
+
# 1 Create a dynamic target for only the spec pod.
|
130
|
+
dynamic_target = build_dynamic_target(dynamic_sandbox, static_installer, platform)
|
131
|
+
|
132
|
+
# 2. Build a new xcodeproj in the dynamic_sandbox with only the spec pod as a target.
|
133
|
+
project = prepare_pods_project(dynamic_sandbox, dynamic_target.name, static_installer)
|
134
|
+
|
135
|
+
# 3. Copy the source directory for the dynamic framework from the static sandbox.
|
136
|
+
copy_dynamic_target(static_sandbox, dynamic_target, dynamic_sandbox)
|
137
|
+
|
138
|
+
# 4. Create the file references.
|
139
|
+
install_file_references(dynamic_sandbox, [dynamic_target], project)
|
140
|
+
|
141
|
+
# 5. Install the target.
|
142
|
+
install_library(dynamic_sandbox, dynamic_target, project)
|
143
|
+
|
144
|
+
# 6. Write the actual .xcodeproj to the dynamic sandbox.
|
145
|
+
write_pod_project(project, dynamic_sandbox)
|
146
|
+
end
|
147
|
+
|
148
|
+
# @param [Pod::Installer] static_installer
|
149
|
+
#
|
150
|
+
# @return [Pod::PodTarget]
|
151
|
+
#
|
152
|
+
def build_dynamic_target(dynamic_sandbox, static_installer, platform)
|
153
|
+
spec_targets = static_installer.pod_targets.select do |target|
|
154
|
+
target.name == @spec.name
|
155
|
+
end
|
156
|
+
static_target = spec_targets[0]
|
157
|
+
|
158
|
+
file_accessors = create_file_accessors(static_target, dynamic_sandbox)
|
159
|
+
|
160
|
+
archs = []
|
161
|
+
dynamic_target = Pod::PodTarget.new(dynamic_sandbox, true, static_target.user_build_configurations, archs, platform, static_target.specs, static_target.target_definitions, file_accessors)
|
162
|
+
dynamic_target
|
163
|
+
end
|
164
|
+
|
165
|
+
# @param [Pod::Sandbox] dynamic_sandbox
|
166
|
+
#
|
167
|
+
# @param [String] spec_name
|
168
|
+
#
|
169
|
+
# @param [Pod::Installer] installer
|
170
|
+
#
|
171
|
+
def prepare_pods_project(dynamic_sandbox, spec_name, installer)
|
172
|
+
# Create a new pods project
|
173
|
+
pods_project = Pod::Project.new(dynamic_sandbox.project_path)
|
174
|
+
|
175
|
+
# Update build configurations
|
176
|
+
installer.analysis_result.all_user_build_configurations.each do |name, type|
|
177
|
+
pods_project.add_build_configuration(name, type)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Add the pod group for only the dynamic framework
|
181
|
+
local = dynamic_sandbox.local?(spec_name)
|
182
|
+
path = dynamic_sandbox.pod_dir(spec_name)
|
183
|
+
was_absolute = dynamic_sandbox.local_path_was_absolute?(spec_name)
|
184
|
+
pods_project.add_pod_group(spec_name, path, local, was_absolute)
|
185
|
+
pods_project
|
186
|
+
end
|
187
|
+
|
188
|
+
def copy_dynamic_target(static_sandbox, _dynamic_target, dynamic_sandbox)
|
189
|
+
command = "cp -a #{static_sandbox.root}/#{@spec.name} #{dynamic_sandbox.root}"
|
190
|
+
`#{command}`
|
191
|
+
end
|
192
|
+
|
193
|
+
def create_file_accessors(target, dynamic_sandbox)
|
194
|
+
pod_root = dynamic_sandbox.pod_dir(target.root_spec.name)
|
195
|
+
|
196
|
+
path_list = Sandbox::PathList.new(pod_root)
|
197
|
+
target.specs.map do |spec|
|
198
|
+
Sandbox::FileAccessor.new(path_list, spec.consumer(target.platform))
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
def install_file_references(dynamic_sandbox, pod_targets, pods_project)
|
203
|
+
installer = Pod::Installer::Xcode::PodsProjectGenerator::FileReferencesInstaller.new(dynamic_sandbox, pod_targets, pods_project)
|
204
|
+
installer.install!
|
205
|
+
end
|
206
|
+
|
207
|
+
def install_library(dynamic_sandbox, dynamic_target, project)
|
208
|
+
return if dynamic_target.target_definitions.flat_map(&:dependencies).empty?
|
209
|
+
target_installer = Pod::Installer::Xcode::PodsProjectGenerator::PodTargetInstaller.new(dynamic_sandbox, project, dynamic_target)
|
210
|
+
result = target_installer.install!
|
211
|
+
native_target = result.native_target
|
212
|
+
|
213
|
+
# Installs System Frameworks
|
214
|
+
if dynamic_target.should_build?
|
215
|
+
dynamic_target.file_accessors.each do |file_accessor|
|
216
|
+
file_accessor.spec_consumer.frameworks.each do |framework|
|
217
|
+
native_target.add_system_framework(framework)
|
218
|
+
end
|
219
|
+
file_accessor.spec_consumer.libraries.each do |library|
|
220
|
+
native_target.add_system_library(library)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
def write_pod_project(dynamic_project, dynamic_sandbox)
|
227
|
+
UI.message "- Writing Xcode project file to #{UI.path dynamic_sandbox.project_path}" do
|
228
|
+
dynamic_project.pods.remove_from_project if dynamic_project.pods.empty?
|
229
|
+
dynamic_project.development_pods.remove_from_project if dynamic_project.development_pods.empty?
|
230
|
+
dynamic_project.sort(:groups_position => :below)
|
231
|
+
dynamic_project.recreate_user_schemes(false)
|
232
|
+
|
233
|
+
# Edit search paths so that we can find our dependency headers
|
234
|
+
dynamic_project.targets.first.build_configuration_list.build_configurations.each do |config|
|
235
|
+
config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) #{Dir.pwd}/Pods/Static/Headers/**"
|
236
|
+
config.build_settings['USER_HEADER_SEARCH_PATHS'] = "$(inherited) #{Dir.pwd}/Pods/Static/Headers/**"
|
237
|
+
config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -ObjC'
|
238
|
+
end
|
239
|
+
dynamic_project.save
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
@@ -0,0 +1,219 @@
|
|
1
|
+
require 'set'
|
2
|
+
module Pod
|
3
|
+
class SpecBuilder
|
4
|
+
def initialize(spec, source, embedded, dynamic)
|
5
|
+
@spec = spec
|
6
|
+
name = spec.attributes_hash['name']
|
7
|
+
version = spec.attributes_hash['version']
|
8
|
+
@source = source.nil? ? "{ :http => 'https://10.0.0.0/staticpods/#{name}/#{name}-#{version}.zip' }" : source
|
9
|
+
@embedded = embedded
|
10
|
+
@dynamic = dynamic
|
11
|
+
@platform = nil
|
12
|
+
end
|
13
|
+
|
14
|
+
def framework_path
|
15
|
+
if @embedded
|
16
|
+
@spec.name + '.embeddedframework' + '/' + @spec.name + '.framework'
|
17
|
+
else
|
18
|
+
@spec.name + '.framework'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def spec_platform(platform)
|
23
|
+
fwk_base = platform.name.to_s + '/' + framework_path
|
24
|
+
spec = <<RB
|
25
|
+
s.#{platform.name}.deployment_target = '#{platform.deployment_target}'
|
26
|
+
s.#{platform.name}.vendored_framework = '#{fwk_base}'
|
27
|
+
RB
|
28
|
+
|
29
|
+
%w(requires_arc xcconfig).each do |attribute|
|
30
|
+
attributes_hash = @spec.attributes_hash[platform.name.to_s]
|
31
|
+
next if attributes_hash.nil?
|
32
|
+
value = attributes_hash[attribute]
|
33
|
+
next if value.nil?
|
34
|
+
|
35
|
+
value = "'#{value}'" if value.class == String
|
36
|
+
spec += " s.#{platform.name}.#{attribute} = #{value}\n"
|
37
|
+
end
|
38
|
+
@platform = platform
|
39
|
+
spec
|
40
|
+
end
|
41
|
+
|
42
|
+
def subspec_json
|
43
|
+
if @spec.subspecs.length < 1
|
44
|
+
return []
|
45
|
+
end
|
46
|
+
new_sub = @spec.subspecs.map {|spec| spec.to_pretty_json}
|
47
|
+
return new_sub
|
48
|
+
end
|
49
|
+
|
50
|
+
def get_all_type(type)
|
51
|
+
subspecs = subspec_json
|
52
|
+
all_frame = Set.new
|
53
|
+
if subspecs.length > 0
|
54
|
+
subspecs.each do |subspec|
|
55
|
+
subspec = JSON.parse(subspec)
|
56
|
+
if !subspec
|
57
|
+
next
|
58
|
+
end
|
59
|
+
df = subspec[type]
|
60
|
+
if df
|
61
|
+
if df.class == String
|
62
|
+
all_frame.add(df)
|
63
|
+
elsif df.class == Array
|
64
|
+
all_frame.merge(df)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
plat = subspec['ios']
|
68
|
+
if plat
|
69
|
+
if plat.class == Hash
|
70
|
+
plat_f = plat[type]
|
71
|
+
if plat_f
|
72
|
+
if plat_f.class == String
|
73
|
+
all_frame.add(plat_f)
|
74
|
+
elsif plat_f.class == Array
|
75
|
+
all_frame.merge(plat_f)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
spec_json = JSON.parse(get_spec_json)
|
83
|
+
dfm = spec_json[type]
|
84
|
+
if dfm
|
85
|
+
if dfm.class == String
|
86
|
+
all_frame.add(dfm)
|
87
|
+
elsif dfm.class == Array
|
88
|
+
all_frame.merge(dfm)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
if !dfm
|
92
|
+
return all_frame
|
93
|
+
end
|
94
|
+
plat = dfm['ios']
|
95
|
+
if plat
|
96
|
+
if plat.class == Hash
|
97
|
+
plat_f = plat[type]
|
98
|
+
if plat_f
|
99
|
+
if plat_f.class == String
|
100
|
+
all_frame.add(plat_f)
|
101
|
+
elsif plat_f.class == Array
|
102
|
+
all_frame.merge(plat_f)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
# puts "get all type --> #{type} value --> #{all_frame}"
|
108
|
+
return all_frame
|
109
|
+
end
|
110
|
+
def get_spec_json
|
111
|
+
return @spec.to_pretty_json
|
112
|
+
end
|
113
|
+
def get_resource
|
114
|
+
return get_spec_json.include?('resource_bundles') || get_spec_json.include?('resource') || get_spec_json.include?('resources') || get_spec_json.include?('resource_bundle')
|
115
|
+
end
|
116
|
+
def process_platform_hash
|
117
|
+
case value = @spec.attributes_hash['platforms']
|
118
|
+
when String
|
119
|
+
{ value => nil }
|
120
|
+
when Array
|
121
|
+
result = {}
|
122
|
+
value.each do |a_value|
|
123
|
+
result[a_value] = nil
|
124
|
+
end
|
125
|
+
result
|
126
|
+
when Hash
|
127
|
+
value
|
128
|
+
else
|
129
|
+
{}
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def get_platform
|
134
|
+
platform_str = ''
|
135
|
+
platform = process_platform_hash
|
136
|
+
if platform
|
137
|
+
if platform['ios']
|
138
|
+
platform_str = " s.platform = :ios, '#{platform['ios']}' \n"
|
139
|
+
else
|
140
|
+
platform_str = " s.platform = :ios"
|
141
|
+
end
|
142
|
+
end
|
143
|
+
platform_str
|
144
|
+
end
|
145
|
+
def get_all_dependenices(plat)
|
146
|
+
depen = @spec.all_dependencies(plat)
|
147
|
+
depen = depen.map {|den| den.name}
|
148
|
+
depen = depen.select {|de| !de.include?('/')}
|
149
|
+
depen
|
150
|
+
end
|
151
|
+
def spec_metadata
|
152
|
+
spec = spec_header
|
153
|
+
spec += get_platform
|
154
|
+
frames = get_all_type('frameworks')
|
155
|
+
if frames.length > 0
|
156
|
+
spec += ' s.frameworks = '
|
157
|
+
frames.each do |val|
|
158
|
+
spec += "'#{val}',"
|
159
|
+
end
|
160
|
+
spec = spec.delete_suffix(',')
|
161
|
+
spec += "\n"
|
162
|
+
end
|
163
|
+
framework = get_all_type('framework')
|
164
|
+
if framework.length > 0
|
165
|
+
framework.each do |val|
|
166
|
+
spec += " s.framework = #{val}\n"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
libs = get_all_type('libraries')
|
170
|
+
if libs.length > 0
|
171
|
+
spec += " s.libraries = "
|
172
|
+
libs.each do |val|
|
173
|
+
spec += "'#{val}',"
|
174
|
+
end
|
175
|
+
spec = spec.delete_suffix(',')
|
176
|
+
spec += "\n"
|
177
|
+
end
|
178
|
+
library = get_all_type('library')
|
179
|
+
if library.length > 0
|
180
|
+
library.each do |val|
|
181
|
+
spec += " s.library = #{val} \n"
|
182
|
+
end
|
183
|
+
end
|
184
|
+
dependices = get_all_dependenices(@platform)
|
185
|
+
if dependices.length > 0
|
186
|
+
dependices.each do |val|
|
187
|
+
spec += " s.dependency '#{val}'"
|
188
|
+
end
|
189
|
+
spec += "\n"
|
190
|
+
end
|
191
|
+
|
192
|
+
res = get_resource
|
193
|
+
if res
|
194
|
+
spec += " s.resources = 'ios/#{framework_path}/Resources/#{@spec.name}.bundle' \n"
|
195
|
+
end
|
196
|
+
spec
|
197
|
+
end
|
198
|
+
|
199
|
+
def spec_close
|
200
|
+
"end\n"
|
201
|
+
end
|
202
|
+
|
203
|
+
private
|
204
|
+
|
205
|
+
def spec_header
|
206
|
+
spec = "Pod::Spec.new do |s|\n"
|
207
|
+
|
208
|
+
%w(name version summary license authors homepage description social_media_url documentation_url requires_arc
|
209
|
+
deployment_target xcconfig).each do |attribute|
|
210
|
+
value = @spec.attributes_hash[attribute]
|
211
|
+
next if value.nil?
|
212
|
+
value = value.dump if value.class == String
|
213
|
+
spec += " s.#{attribute} = #{value}\n"
|
214
|
+
end
|
215
|
+
|
216
|
+
spec + " s.source = #{@source}\n\n"
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|