Skip to content

Instantly share code, notes, and snippets.

@WiesnerPeti
Last active January 3, 2020 12:45
Show Gist options
  • Select an option

  • Save WiesnerPeti/47ef4c530d78e90624b0171eae8a4454 to your computer and use it in GitHub Desktop.

Select an option

Save WiesnerPeti/47ef4c530d78e90624b0171eae8a4454 to your computer and use it in GitHub Desktop.

Revisions

  1. Peter Adam Wiesner revised this gist Jan 3, 2020. No changes.
  2. Peter Adam Wiesner created this gist Jan 3, 2020.
    22 changes: 22 additions & 0 deletions PodPostInstall.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    post_install do |installer|
    installer.aggregate_targets.each do |aggregate_target|
    if aggregate_target.name == "YOUR_TARGET"
    aggregate_target.xcconfigs.each do |config_name, config_file|

    #Example to get and set attributes
    frameworkSearchPaths = config_file.attributes["FRAMEWORK_SEARCH_PATHS"]
    config_file.attributes["FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]"] = frameworkSearchPaths

    #Example to delete attributes
    config_file.attributes.delete("FRAMEWORK_SEARCH_PATHS")

    #Example to delete linker flags
    config_file.other_linker_flags.clear

    #Example to save changes
    xcconfig_path = aggregate_target.xcconfig_path(config_name)
    config_file.save_as(xcconfig_path)
    end
    end
    end
    end