Module: CocoaPodsAcknowledgements
- Defined in:
- lib/cocoapods_acknowledgements.rb,
lib/cocoapods_acknowledgements/version.rb,
lib/cocoapods_acknowledgements/plist_generator.rb,
lib/cocoapods_acknowledgements/settings_plist_generator.rb
Defined Under Namespace
Classes: PlistGenerator, SettingsPlistGenerator
Constant Summary
collapse
- VERSION =
"1.3.0"
Class Method Summary
collapse
Class Method Details
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/cocoapods_acknowledgements.rb', line 5
def self.save_metadata(metadata, plist_path, project, sandbox, user_target_uuid)
if defined? Xcodeproj::Plist.write_to_path
Xcodeproj::Plist.write_to_path(metadata, plist_path)
else
Xcodeproj.write_plist(metadata, plist_path)
end
cocoapods_group = project.main_group["Pods"]
unless cocoapods_group
cocoapods_group = project.main_group.new_group("Pods", sandbox.root)
end
plist_pathname = Pathname.new(File.expand_path(plist_path))
file_ref = cocoapods_group.files.find { |file| file.real_path == plist_pathname }
unless file_ref
file_ref = cocoapods_group.new_file(plist_path)
end
target = project.objects_by_uuid[user_target_uuid]
unless target.resources_build_phase.files_references.include?(file_ref)
target.add_resources([file_ref])
end
project.save
end
|
.settings_bundle_in_project(project) ⇒ Object
34
35
36
37
|
# File 'lib/cocoapods_acknowledgements.rb', line 34
def self.settings_bundle_in_project(project)
file = project.files.find { |f| f.path =~ /Settings\.bundle$/ }
file.real_path.to_path unless file.nil?
end
|