Need a way to include WebKitAdditions code in WebKit API headers
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 23:34:04 +0000 (23:34 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Mar 2019 23:34:04 +0000 (23:34 +0000)
commit8a9e5221ed457b1ba3ca86cd1f90ab082622b2b0
tree82bede018b6913e9e6008319d79e7b482d37afa0
parentf24e737dd0da03cfabed62ab4682d5a26b545c62
Need a way to include WebKitAdditions code in WebKit API headers
https://bugs.webkit.org/show_bug.cgi?id=196173

Reviewed by Tim Horton.

Introduce a mechanism that allows us to insert code from WebKitAdditions into public or private SDK headers
using `#import`s of the form:

```
#if USE(APPLE_INTERNAL_SDK)
#import <WebKitAdditions/WKWebViewConfigurationAdditions.h>
#endif
```

The resulting header in the built products directory will contain the contents of the imported file inserted in
place of the `#if USE(APPLE_INTERNAL_SDK) … #endif` block; however, when building with the Apple internal SDK,
the additions header content will be imported by the usual means.

* mac/postprocess-framework-headers.sh:
* mac/replace-webkit-additions-includes.py: Added.

Add a step when post-processing framework headers to replace instances of `#if USE(APPLE_INTERNAL_SDK) … #endif`
with the text content of the additions files. The replacement script first searches in the built products
directory for the matching additions file, and falls back to the SDK if no matching file is found. If neither
are present (e.g. a build using the public SDK), then the block is simply replaced by the empty string.

(read_content_from_webkit_additions):
(main):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/mac/postprocess-framework-headers.sh
Source/WebKit/mac/replace-webkit-additions-includes.py [new file with mode: 0755]