Add the ability to import WebKitAdditions snippets in WebKit.apinotes
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 04:20:38 +0000 (04:20 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 May 2019 04:20:38 +0000 (04:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197487
<rdar://problem/50389085>

Reviewed by Tim Horton.

* Shared/API/Cocoa/WebKit.apinotes: Import a new WebKitAdditions file.

* WebKit.xcodeproj/project.pbxproj: Check all files in Headers/ and PrivateHeaders/ that need replacement, not
simply anything ending with ".h".

* mac/replace-webkit-additions-includes.py:
(main): Teach the replacement script to handle files in Headers/ or PrivateHeaders/ that don't end in ".h".

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244866 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/Shared/API/Cocoa/WebKit.apinotes
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/mac/replace-webkit-additions-includes.py

index 1df7f99..4da3384 100644 (file)
@@ -1,3 +1,19 @@
+2019-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        Add the ability to import WebKitAdditions snippets in WebKit.apinotes
+        https://bugs.webkit.org/show_bug.cgi?id=197487
+        <rdar://problem/50389085>
+
+        Reviewed by Tim Horton.
+
+        * Shared/API/Cocoa/WebKit.apinotes: Import a new WebKitAdditions file.
+
+        * WebKit.xcodeproj/project.pbxproj: Check all files in Headers/ and PrivateHeaders/ that need replacement, not
+        simply anything ending with ".h".
+
+        * mac/replace-webkit-additions-includes.py:
+        (main): Teach the replacement script to handle files in Headers/ or PrivateHeaders/ that don't end in ".h".
+
 2019-05-01  Alex Christensen  <achristensen@webkit.org>
 
         Protect against null crash in fetchDiskCacheEntries
index d711df4..3efc939 100644 (file)
@@ -200,3 +200,6 @@ Classes:
 Tags:
 - Name: WKErrorCode
   NSErrorDomain: WKErrorDomain
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WebKitAdditions.apinotes>
+#endif
index 796ec89..37879b5 100644 (file)
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "if [ \"${XCODE_VERSION_MAJOR}\" -ge \"1100\" -a \"${USE_NEW_BUILD_SYSTEM}\" = \"YES\" ]; then\n    # In this configuration, post-processing is performed at the same time as copying in the postprocess-header-rule script, so there's no need for this separate step.\n    exit 0\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" -o \"${ACTION}\" = \"installapi\" ]; then\n    for HEADERS_DIRECTORY in \"${PUBLIC_HEADERS_FOLDER_PATH}\" \"${PRIVATE_HEADERS_FOLDER_PATH}\"; do\n        for HEADER_PATH in \"${TARGET_BUILD_DIR}/${HEADERS_DIRECTORY}/\"*.h; do\n            if [[ ! -z `grep '#import <WebKitAdditions/.*\\.h>' \"${HEADER_PATH}\"` ]]; then\n                python \"${SRCROOT}/mac/replace-webkit-additions-includes.py\" \"${HEADER_PATH}\" \"${BUILT_PRODUCTS_DIR}\" \"${SDKROOT}\" || exit $?\n            fi\n        done\n    done\nfi\n";
+                       shellScript = "if [ \"${XCODE_VERSION_MAJOR}\" -ge \"1100\" -a \"${USE_NEW_BUILD_SYSTEM}\" = \"YES\" ]; then\n    # In this configuration, post-processing is performed at the same time as copying in the postprocess-header-rule script, so there's no need for this separate step.\n    exit 0\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" -o \"${ACTION}\" = \"installapi\" ]; then\n    for HEADERS_DIRECTORY in \"${PUBLIC_HEADERS_FOLDER_PATH}\" \"${PRIVATE_HEADERS_FOLDER_PATH}\"; do\n        for HEADER_PATH in \"${TARGET_BUILD_DIR}/${HEADERS_DIRECTORY}/\"*.*; do\n            if [[ ! -z `grep '#import <WebKitAdditions/.*>' \"${HEADER_PATH}\"` ]]; then\n                python \"${SRCROOT}/mac/replace-webkit-additions-includes.py\" \"${HEADER_PATH}\" \"${BUILT_PRODUCTS_DIR}\" \"${SDKROOT}\" || exit $?\n            fi\n        done\n    done\nfi\n\n\n";
                };
 /* End PBXShellScriptBuildPhase section */
 
index d79e628..ed339c5 100755 (executable)
@@ -65,7 +65,7 @@ def main(argv=None):
         print("(%s): SDK root directory unspecified" % argv[0])
         return 1
 
-    additions_import_pattern = re.compile(r"\#if USE\(APPLE_INTERNAL_SDK\)\n#import <WebKitAdditions/(.*\.h)>\n#endif")
+    additions_import_pattern = re.compile(r"\#if USE\(APPLE_INTERNAL_SDK\)\n#import <WebKitAdditions/(.*)>\n#endif")
     try:
         with open(header_path, "r") as header:
             header_contents = header.read()