Fix Obj-C and Swift builds which are broken in v0.6.13 (#192)

Summary:
9f807c introduced a new subspec in SonarKit.podspec, which caused Cpp header files to be included in `SonarKit-umbrella.h`, causing all non-ObjC++ project integrations to fail to build (see #190 for more info). SirArkimedes and I investigated this today and found the fix:

1. Make the `CppBridge` subspec's header files private
2. Add a hack to make Cocoapods copy `FBMacros.h` into `{PODS_ROOT}/Headers/Public/SonarKit`, since otherwise `#import "FBMacros.h"` in `SonarKit-umbrella.h` will fail to resolve in out-of-the-box projects.

I've put up a branch [here](https://github.com/noahsark769/sonar-testing-example-projects/tree/working_reference) which pulls the pod from this branch and verifies that the fix works.

Fixes #190
Pull Request resolved: https://github.com/facebook/Sonar/pull/192

Reviewed By: passy

Differential Revision: D9049420

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 9383016975607e897085323d64ad44a068199918
This commit is contained in:
Noah Gilmore
2018-07-31 08:31:35 -07:00
committed by Pascal Hartig
parent b2193c091a
commit 68789e7c96
2 changed files with 3 additions and 17 deletions

View File

@@ -1,16 +0,0 @@
/*
* Copyright (c) 2004-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#ifndef FB_SK_MACROS_H
#define FB_SK_MACROS_H
#define FB_LINK_REQUIRE_(NAME, UNIQUE)
#define FB_LINKABLE(NAME)
#define FB_LINK_REQUIRE(NAME)
#define FB_LINK_REQUIRE_EXT(NAME)
#endif

View File

@@ -31,7 +31,9 @@ Pod::Spec.new do |spec|
ss.header_dir = 'CppBridge'
ss.compiler_flags = folly_compiler_flags
ss.source_files = 'iOS/SonarKit/CppBridge/**/*.{h,mm}'
ss.public_header_files = 'iOS/SonarKit/CppBridge/**/*.h'
# We set these files as private headers since they only need to be accessed
# by other SonarKit source files
ss.private_header_files = 'iOS/SonarKit/CppBridge/**/*.h'
ss.preserve_path = 'SonarKit/CppBridge/**/*.h'
end