[Xcode] Incremental builds of WebKitLegacy are slow because of the Postprocess Header...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Mar 2017 17:51:45 +0000 (17:51 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Mar 2017 17:51:45 +0000 (17:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169861

Reviewed by Sam Weinig.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj: Specified that the Postprocess Headers script build
  phase has the Headers and PrivateHeaders directories as its inputs and a timestamp file as
  its output.

Source/WebKit/mac:

* MigrateHeaders.make: Touch the PrivateHeaders directory when migrating a header into it.
* postprocess-headers.sh: Preserve the timestamp on the headers directories. Write out the
  timestamp file used by the Xcode project to determine whether to run the script.

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

Source/WebKit/ChangeLog
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/MigrateHeaders.make
Source/WebKit/mac/postprocess-headers.sh

index f520b7b..5cd1415 100644 (file)
@@ -1,3 +1,14 @@
+2017-03-20  Dan Bernstein  <mitz@apple.com>
+
+        [Xcode] Incremental builds of WebKitLegacy are slow because of the Postprocess Headers phase
+        https://bugs.webkit.org/show_bug.cgi?id=169861
+
+        Reviewed by Sam Weinig.
+
+        * WebKit.xcodeproj/project.pbxproj: Specified that the Postprocess Headers script build
+          phase has the Headers and PrivateHeaders directories as its inputs and a timestamp file as
+          its output.
+
 2017-03-15  Dean Jackson  <dino@apple.com>
 
         Sort Xcode project files
index bbd6394..2cc411c 100644 (file)
                        files = (
                        );
                        inputPaths = (
+                               "$(TARGET_BUILD_DIR)/$(PRIVATE_HEADERS_FOLDER_PATH)",
+                               "$(TARGET_BUILD_DIR)/$(HEADERS_FOLDER_PATH)",
                        );
                        name = "Postprocess Headers";
                        outputPaths = (
+                               "$(DERIVED_FILE_DIR)/postprocess-headers.timestamp",
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
index ccd9c94..869af68 100644 (file)
@@ -1,3 +1,14 @@
+2017-03-20  Dan Bernstein  <mitz@apple.com>
+
+        [Xcode] Incremental builds of WebKitLegacy are slow because of the Postprocess Headers phase
+        https://bugs.webkit.org/show_bug.cgi?id=169861
+
+        Reviewed by Sam Weinig.
+
+        * MigrateHeaders.make: Touch the PrivateHeaders directory when migrating a header into it.
+        * postprocess-headers.sh: Preserve the timestamp on the headers directories. Write out the
+          timestamp file used by the Xcode project to determine whether to run the script.
+
 2017-03-19  Alexey Proskuryakov  <ap@apple.com>
 
         WebHTMLView is useless as WebResourceHandler
index ceb38e8..5931325 100644 (file)
@@ -71,7 +71,7 @@ endif
 all : $(HEADERS)
 
 WEBCORE_HEADER_REPLACE_RULES = -e 's/<WebCore\//<WebKitLegacy\//' -e "s/(^ *)WEBCORE_EXPORT /\1/"
-WEBCORE_HEADER_MIGRATE_CMD = sed -E $(WEBCORE_HEADER_REPLACE_RULES) $< > $@
+WEBCORE_HEADER_MIGRATE_CMD = sed -E $(WEBCORE_HEADER_REPLACE_RULES) $< > $@; touch $(PRIVATE_HEADERS_DIR)
 
 $(PRIVATE_HEADERS_DIR)/% : % MigrateHeaders.make
        $(WEBCORE_HEADER_MIGRATE_CMD)
index dd26ab6..ac54f11 100755 (executable)
@@ -2,6 +2,8 @@
 
 postProcessInDirectory()
 {
+    touch -r "$1" "${TARGET_TEMP_DIR}/postprocess-headers-saved.timestamp"
+
     cd "$1"
 
     local unifdefOptions sedExpression
@@ -65,7 +67,11 @@ postProcessInDirectory()
             mv ${header}.sed ${header}
         fi
     done
+
+    touch -r "${TARGET_TEMP_DIR}/postprocess-headers-saved.timestamp" "$1"
 }
 
 postProcessInDirectory "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}"
 postProcessInDirectory "${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}"
+
+touch "${DERIVED_FILE_DIR}/postprocess-headers.timestamp"