|
| 1 | +folly_compiler_flags = '-DFB_SONARKIT_ENABLED=1 -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_HAVE_LIBGFLAGS=0 -DFOLLY_HAVE_LIBJEMALLOC=0 -DFOLLY_HAVE_PREADV=0 -DFOLLY_HAVE_PWRITEV=0 -DFOLLY_HAVE_TFO=0 -DFOLLY_USE_SYMBOLIZER=0' |
| 2 | +yoga_version = '~> 1.9' |
| 3 | +yogakit_version = '~>1.8' |
| 4 | +sonarkit_version = '0.6.15' |
| 5 | +Pod::Spec.new do |spec| |
| 6 | + spec.name = 'SonarKit' |
| 7 | + spec.version = sonarkit_version |
| 8 | + spec.license = { :type => 'MIT' } |
| 9 | + spec.homepage = 'https://github.com/facebook/Sonar' |
| 10 | + spec.summary = 'Sonar iOS podspec' |
| 11 | + spec.authors = 'Facebook' |
| 12 | + spec.static_framework = true |
| 13 | + spec.source = { :git => 'https://github.com/facebook/Sonar.git', |
| 14 | + :tag=> "v"+sonarkit_version } |
| 15 | + spec.module_name = 'SonarKit' |
| 16 | + spec.platforms = { :ios => "8.4" } |
| 17 | + spec.default_subspecs = "Core" |
| 18 | + |
| 19 | + # This subspec is necessary since FBMacros.h is imported as <FBDefines/FBMacros.h> |
| 20 | + # inside SKMacros.h, which is a public header file. Defining this directory as a |
| 21 | + # subspec with header_dir = 'FBDefines' allows this to work, even though it wouldn't |
| 22 | + # generally (you would need to import <SonarKit/FBDefines/FBMacros.h>) |
| 23 | + spec.subspec 'FBDefines' do |ss| |
| 24 | + ss.header_dir = 'FBDefines' |
| 25 | + ss.compiler_flags = folly_compiler_flags |
| 26 | + ss.source_files = 'iOS/FBDefines/**/*.h' |
| 27 | + ss.public_header_files = 'iOS/FBDefines/**/*.h' |
| 28 | + end |
| 29 | + |
| 30 | + spec.subspec 'CppBridge' do |ss| |
| 31 | + ss.header_dir = 'CppBridge' |
| 32 | + ss.compiler_flags = folly_compiler_flags |
| 33 | + ss.source_files = 'iOS/SonarKit/CppBridge/**/*.{h,mm}' |
| 34 | + # We set these files as private headers since they only need to be accessed |
| 35 | + # by other SonarKit source files |
| 36 | + ss.private_header_files = 'iOS/SonarKit/CppBridge/**/*.h' |
| 37 | + ss.preserve_path = 'SonarKit/CppBridge/**/*.h' |
| 38 | + end |
| 39 | + |
| 40 | + spec.subspec 'FBCxxUtils' do |ss| |
| 41 | + ss.header_dir = 'FBCxxUtils' |
| 42 | + ss.compiler_flags = folly_compiler_flags |
| 43 | + ss.source_files = 'iOS/SonarKit/FBCxxUtils/**/*.{h,mm}' |
| 44 | + # We set these files as private headers since they only need to be accessed |
| 45 | + # by other SonarKit source files |
| 46 | + ss.private_header_files = 'iOS/SonarKit/FBCxxUtils/**/*.h' |
| 47 | + end |
| 48 | + |
| 49 | + spec.subspec "Core" do |ss| |
| 50 | + ss.dependency 'SonarKit/FBDefines' |
| 51 | + ss.dependency 'SonarKit/FBCxxUtils' |
| 52 | + ss.dependency 'SonarKit/CppBridge' |
| 53 | + ss.dependency 'Folly', '~>1.0' |
| 54 | + ss.dependency 'Sonar', '~>'+sonarkit_version |
| 55 | + ss.dependency 'CocoaAsyncSocket', '~> 7.6' |
| 56 | + ss.dependency 'PeerTalk', '~>0.0.2' |
| 57 | + ss.dependency 'OpenSSL-Static', '1.0.2.c1' |
| 58 | + ss.compiler_flags = folly_compiler_flags |
| 59 | + ss.source_files = 'iOS/SonarKit/FBDefines/*.{h,cpp,m,mm}', 'iOS/SonarKit/CppBridge/*.{h,mm}', 'iOS/SonarKit/FBCxxUtils/*.{h,mm}', 'iOS/SonarKit/Utilities/**/*.{h,m}', 'iOS/SonarKit/*.{h,m,mm}' |
| 60 | + ss.public_header_files = 'iOS/SonarKit/**/{SonarClient,SonarPlugin,SonarConnection,SonarResponder,SKMacros}.h' |
| 61 | + header_search_paths = "\"$(PODS_ROOT)/SonarKit/iOS/SonarKit\" \"$(PODS_ROOT)\"/Headers/Private/SonarKit/** \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/PeerTalkSonar\"" |
| 62 | + ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", |
| 63 | + "DEFINES_MODULE" => "YES", |
| 64 | + "HEADER_SEARCH_PATHS" => header_search_paths } |
| 65 | + end |
| 66 | + |
| 67 | + spec.subspec "SonarKitLayoutPlugin" do |ss| |
| 68 | + ss.header_dir = "SonarKitLayoutPlugin" |
| 69 | + ss.dependency 'SonarKit/Core' |
| 70 | + ss.dependency 'Yoga', yoga_version |
| 71 | + ss.dependency 'YogaKit', yogakit_version |
| 72 | + ss.compiler_flags = folly_compiler_flags |
| 73 | + ss.public_header_files = 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SonarKitLayoutPlugin.h', |
| 74 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKTouch.h', |
| 75 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKDescriptorMapper.h', |
| 76 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKNodeDescriptor.h', |
| 77 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKInvalidation.h', |
| 78 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKNamed.h', |
| 79 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKTapListener.h', |
| 80 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKObject.h', |
| 81 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SKHighlightOverlay.h', |
| 82 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/UIColor+SKSonarValueCoder.h', |
| 83 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/utils/SKObjectHash.h', |
| 84 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/utils/SKSwizzle.h', |
| 85 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/utils/SKYogaKitHelper.h' |
| 86 | + ss.source_files = 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/**/*.{h,cpp,m,mm}' |
| 87 | + end |
| 88 | + |
| 89 | + spec.subspec "SonarKitLayoutComponentKitSupport" do |ss| |
| 90 | + ss.header_dir = "SonarKitLayoutComponentKitSupport" |
| 91 | + ss.dependency 'SonarKit/Core' |
| 92 | + ss.dependency 'Yoga', yoga_version |
| 93 | + ss.dependency 'ComponentKit' |
| 94 | + ss.dependency 'SonarKit/SonarKitLayoutPlugin' |
| 95 | + ss.compiler_flags = folly_compiler_flags |
| 96 | + ss.dependency 'SonarKit/SonarKitLayoutPlugin' |
| 97 | + ss.public_header_files = 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutComponentKitSupport/SonarKitLayoutComponentKitSupport.h', |
| 98 | + 'iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutComponentKitSupport/SKComponentLayoutWrapper.h' |
| 99 | + |
| 100 | + ss.source_files = "iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutComponentKitSupport/**/*.{h,cpp,m,mm}" |
| 101 | + ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", |
| 102 | + "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)\"/Headers/Private/SonarKit/**" } |
| 103 | + end |
| 104 | + |
| 105 | + spec.subspec "SonarKitNetworkPlugin" do |ss| |
| 106 | + ss.header_dir = "SonarKitNetworkPlugin" |
| 107 | + ss.dependency 'SonarKit/Core' |
| 108 | + ss.compiler_flags = folly_compiler_flags |
| 109 | + ss.public_header_files = 'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SonarKitNetworkPlugin.h', |
| 110 | + 'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKBufferingPlugin.h', |
| 111 | + 'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKDispatchQueue.h', |
| 112 | + 'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKNetworkReporter.h' |
| 113 | + ss.source_files = "iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/*.{h,cpp,m,mm}" |
| 114 | + ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", |
| 115 | + "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)\"/Headers/Private/SonarKit/**" } |
| 116 | + end |
| 117 | + |
| 118 | + spec.subspec "SKIOSNetworkPlugin" do |ss| |
| 119 | + ss.header_dir = "SKIOSNetworkPlugin" |
| 120 | + ss.dependency 'SonarKit/Core' |
| 121 | + ss.dependency 'SonarKit/SonarKitNetworkPlugin' |
| 122 | + ss.compiler_flags = folly_compiler_flags |
| 123 | + ss.public_header_files = 'iOS/Plugins/SonarKitNetworkPlugin/SKIOSNetworkPlugin/SKIOSNetworkAdapter.h' |
| 124 | + ss.source_files = "iOS/Plugins/SonarKitNetworkPlugin/SKIOSNetworkPlugin/**/*.{h,cpp,m,mm}" |
| 125 | + ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", |
| 126 | + "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)\"/Headers/Private/SonarKit/**" } |
| 127 | + end |
| 128 | +end |
0 commit comments