the question is: cocoapods generates xcconfig
file project , want include xcconfig
file dependency it. able in example in post_install
hook? i've found xcbuildconfiguration has build_settings
hash, far understood can add or change keys , not include statements hash.
following instructions this answer able update xcconfig
, use code include xcconfig
file pod's generated:
post_install |installer| installer.pods_project.targets.each |target| next unless target.name.include?("pods-cnisdk") puts "updating #{target.name}" target.build_configurations.each |config| xcconfig_path = config.base_configuration_reference.real_path # read xcconfig build_settings dictionary build_settings = hash[*file.read(xcconfig_path).lines.map{|x| x.split(/\s*=\s*/, 2)}.flatten] # write build_settings dictionary xcconfig file.open(xcconfig_path, "w") |file| file.puts "#include \"../configurations/warnings.xcconfig\"\n" build_settings.each |key,value| file.puts "#{key} = #{value}" end end end end end
Comments
Post a Comment