blob: b19cecccbc987219734e3c1a672146a991c97c50 [file] [log] [blame]
Jorge Canizales249483e2015-06-01 19:55:27 -07001# This file describes to Cocoapods how to integrate the Objective-C runtime into a dependent
2# project.
3# Despite this file being specific to Objective-C, it needs to be on the root of the repository.
4# Otherwise, Cocoapods gives trouble like not picking up the license file correctly, or not letting
5# dependent projects use the :git notation to refer to the library.
Jorge Canizales687a5fe2015-05-13 19:54:55 -07006Pod::Spec.new do |s|
7 s.name = 'Protobuf'
deannagarcia92db7e22025-02-06 09:35:19 -08008 s.version = '4.31.0'
Jorge Canizales687a5fe2015-05-13 19:54:55 -07009 s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
Feng Xiaoafe98de2018-08-22 11:55:30 -070010 s.homepage = 'https://github.com/protocolbuffers/protobuf'
Maximilian82372d82022-01-27 01:23:14 +010011 s.license = 'BSD-3-Clause'
Jorge Canizales592c44f2015-05-14 14:16:40 -070012 s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
Thomas Van Lenten0d915152024-01-29 10:41:19 -080013
14 # Ensure developers won't hit CocoaPods/CocoaPods#11402 with the resource
15 # bundle for the privacy manifest.
16 s.cocoapods_version = '>= 1.12.0'
Jorge Canizales687a5fe2015-05-13 19:54:55 -070017
Feng Xiaoafe98de2018-08-22 11:55:30 -070018 s.source = { :git => 'https://github.com/protocolbuffers/protobuf.git',
Deanna Garcia942cec02022-05-20 21:43:48 +000019 :tag => "v#{s.version}" }
Jorge Canizalesf492dd82016-02-10 19:19:17 -080020
Thomas Van Lentend9caebc2024-10-10 14:32:22 -070021 s.source_files = 'objectivec/*.{h,m,swift}'
TeBoringfe982642015-08-26 23:55:33 -070022 # The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be
23 # left out, as it's an umbrella implementation file.
24 s.exclude_files = 'objectivec/GPBProtocolBuffers.m'
Thomas Van Lenten7da023b2016-05-09 13:53:20 -040025
Thomas Van Lenten6750ed82024-07-03 08:54:56 -070026 # Now that there is a Swift source file, set a version.
27 s.swift_version = '5.0'
28
Thomas Van Lenten0d915152024-01-29 10:41:19 -080029 s.resource_bundle = {
30 "Protobuf_Privacy" => "PrivacyInfo.xcprivacy"
31 }
32
Thomas Van Lenten7da023b2016-05-09 13:53:20 -040033 # Set a CPP symbol so the code knows to use framework imports.
34 s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
35 s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
Jorge Canizales687a5fe2015-05-13 19:54:55 -070036
Sandy Zhang9f1b38e2024-10-22 12:54:46 -070037 s.ios.deployment_target = '15.0'
38 s.osx.deployment_target = '11.0'
39 # The following are best-effort / community supported, and are not covered by
40 # our official support policies: https://protobuf.dev/support/version-support/
Thomas Van Lentena6f9ec82022-09-23 15:35:39 -040041 s.tvos.deployment_target = '12.0'
42 s.watchos.deployment_target = '6.0'
YoloMao8afaae52024-02-22 19:23:32 -080043 s.visionos.deployment_target = '1.0'
Jorge Canizales687a5fe2015-05-13 19:54:55 -070044 s.requires_arc = false
Thomas Van Lenten35fcbfd2022-04-26 12:43:54 -040045
46 # The unittest need the generate sources from the testing related .proto
47 # files. So to add a `test_spec`, there would also need to be something like a
48 # `script_phases` to generate them, but there would also need to be a way to
49 # ensure `protoc` had be built. Another option would be to move to a model
50 # where the needed files are always generated and checked in. Neither of these
51 # seem that great at the moment, so the tests have *not* been wired into here
52 # at this time.
Jorge Canizales687a5fe2015-05-13 19:54:55 -070053end