1require 'json'
2
3package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
4
5Pod::Spec.new do |s|
6  s.name           = 'EXUpdates'
7  s.version        = package['version']
8  s.summary        = package['description']
9  s.description    = package['description']
10  s.license        = package['license']
11  s.author         = package['author']
12  s.homepage       = package['homepage']
13  s.platform       = :ios, '13.0'
14  s.swift_version  = '5.4'
15  s.source         = { git: 'https://github.com/expo/expo.git' }
16  s.static_framework = true
17
18  s.dependency 'ExpoModulesCore'
19  s.dependency 'React-Core'
20  s.dependency 'EXStructuredHeaders'
21  s.dependency 'EXUpdatesInterface'
22  s.dependency 'EXManifests'
23  s.dependency 'EASClient'
24  s.dependency 'ASN1Decoder', '~> 1.8'
25
26  s.pod_target_xcconfig = {
27    'GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS' => 'YES',
28    'GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS' => 'YES',
29    'DEFINES_MODULE' => 'YES',
30    'SWIFT_COMPILATION_MODE' => 'wholemodule'
31  }
32
33  if !$ExpoUseSources&.include?(package['name']) && ENV['EXPO_USE_SOURCE'].to_i == 0 && File.exist?("#{s.name}.xcframework") && Gem::Version.new(Pod::VERSION) >= Gem::Version.new('1.10.0')
34    s.source_files = "#{s.name}/**/*.h"
35    s.vendored_frameworks = "#{s.name}.xcframework"
36  else
37    s.source_files = "#{s.name}/**/*.{h,m,swift}"
38  end
39
40  if $expo_updates_create_manifest != false
41    s.script_phase = {
42      :name => 'Generate app.manifest for expo-updates',
43      :script => 'bash -l -c "$PODS_TARGET_SRCROOT/../scripts/create-manifest-ios.sh"',
44      :execution_position => :before_compile
45    }
46
47    # Generate EXUpdates.bundle without existing resources
48    # `create-manifest-ios.sh` will generate app.manifest in EXUpdates.bundle
49    s.resource_bundles = {
50      'EXUpdates' => []
51    }
52  end
53
54  s.test_spec 'Tests' do |test_spec|
55    test_spec.source_files = 'Tests/*.{h,m,swift}'
56    test_spec.resources = 'Tests/Support/**/*'
57    test_spec.dependency 'OCMockito', '~> 6.0'
58    test_spec.pod_target_xcconfig = {
59    'GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS' => 'YES',
60    'GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS' => 'YES',
61    'DEFINES_MODULE' => 'YES',
62    'SWIFT_COMPILATION_MODE' => 'wholemodule'
63  }
64  end
65end
66