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.1.1"
Class Method Summary collapse
- .save_metadata(metadata, plist_path, project, sandbox, user_target_uuid) ⇒ Object
-
.settings_bundle_in_project ⇒ Object
TODO: Code golf this.
Class Method Details
.save_metadata(metadata, plist_path, project, sandbox, user_target_uuid) ⇒ Object
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 33 |
# File 'lib/cocoapods_acknowledgements.rb', line 5 def self.(, plist_path, project, sandbox, user_target_uuid) if defined? Xcodeproj::Plist.write_to_path Xcodeproj::Plist.write_to_path(, plist_path) else Xcodeproj.write_plist(, plist_path) end # Find a root folder in the users Xcode Project called Pods, or make one cocoapods_group = project.main_group["Pods"] unless cocoapods_group cocoapods_group = project.main_group.new_group("Pods", sandbox.root) end # Add the example plist to the found CocoaPods group plist_pathname = Pathname.new(File.(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 # Ensure that the plist is added to target 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 ⇒ Object
TODO: Code golf this
36 37 38 |
# File 'lib/cocoapods_acknowledgements.rb', line 36 def self.settings_bundle_in_project Dir.glob("**/*Settings.bundle").first end |