[GTK] Generate the make dist manifest from a CMake template file
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Jan 2015 21:58:05 +0000 (21:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Jan 2015 21:58:05 +0000 (21:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139387

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-01-19
Reviewed by Martin Robinson.

.:

Generate manifest.txt from manifest.txt.in. Only expose the dist and
distcheck targets for developer builds, as they won't work when
building from a tarball because the manifest is not distributed.

* Source/PlatformGTK.cmake:

Tools:

Remove the code that performs variable substitution on manifest.txt.
Replace the custom variables used in that file with CMake variables.

* gtk/make-dist.py:
(Manifest.add_directory):
(Manifest.get_full_source_path):
(Manifest.process_line):
(Manifest.resolve_variables): Deleted.
(Manifest.get_full_tarball_path): Deleted.
* gtk/manifest.txt.in: Renamed from Tools/gtk/manifest.txt.

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

ChangeLog
Source/PlatformGTK.cmake
Tools/ChangeLog
Tools/gtk/make-dist.py
Tools/gtk/manifest.txt.in [moved from Tools/gtk/manifest.txt with 94% similarity]

index edf036e..103b66a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2015-01-19  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] Generate the make dist manifest from a CMake template file
+        https://bugs.webkit.org/show_bug.cgi?id=139387
+
+        Reviewed by Martin Robinson.
+
+        Generate manifest.txt from manifest.txt.in. Only expose the dist and
+        distcheck targets for developer builds, as they won't work when
+        building from a tarball because the manifest is not distributed.
+
+        * Source/PlatformGTK.cmake:
+
 2015-01-15  Csaba Osztrogonác  <ossy@webkit.org>
 
         Remove ENABLE(SQL_DATABASE) guards
index 0ce6df1..cc044bc 100644 (file)
@@ -51,40 +51,46 @@ add_custom_target(check
     COMMAND ${TOOLS_DIR}/gtk/check-for-webkitdom-api-breaks
 )
 
+if (DEVELOPER_MODE)
+    configure_file(
+        ${TOOLS_DIR}/gtk/manifest.txt.in
+        ${CMAKE_BINARY_DIR}/manifest.txt
+    )
 
-add_custom_command(
-    OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
-    DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
-    DEPENDS ${TOOLS_DIR}/gtk/manifest.txt
-    DEPENDS WebKit2
-    DEPENDS gtkdoc
-    COMMAND ${TOOLS_DIR}/gtk/make-dist.py
-            --source-dir=${CMAKE_SOURCE_DIR}
-            --build-dir=${CMAKE_BINARY_DIR}
-            --version=${PROJECT_VERSION}
-            ${TOOLS_DIR}/gtk/manifest.txt
-)
+    add_custom_command(
+        OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
+        DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
+        DEPENDS ${CMAKE_BINARY_DIR}/manifest.txt
+        DEPENDS WebKit2
+        DEPENDS gtkdoc
+        COMMAND ${TOOLS_DIR}/gtk/make-dist.py
+                --source-dir=${CMAKE_SOURCE_DIR}
+                --build-dir=${CMAKE_BINARY_DIR}
+                --version=${PROJECT_VERSION}
+                ${CMAKE_BINARY_DIR}/manifest.txt
+    )
 
-add_custom_command(
-    OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
-    DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
-    COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
-)
+    add_custom_command(
+        OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
+        DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
+        COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
+    )
 
-add_custom_target(dist
-    DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
-)
+    add_custom_target(dist
+        DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
+    )
 
-add_custom_target(distcheck
-    DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
-    DEPENDS ${TOOLS_DIR}/gtk/manifest.txt
-    DEPENDS WebKit2
-    DEPENDS gtkdoc
-    COMMAND ${TOOLS_DIR}/gtk/make-dist.py
-            --check
-            --source-dir=${CMAKE_SOURCE_DIR}
-            --build-dir=${CMAKE_BINARY_DIR}
-            --version=/webkitgtk-${PROJECT_VERSION}
-            ${TOOLS_DIR}/gtk/manifest.txt
-    COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
-)
+    add_custom_target(distcheck
+        DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
+        DEPENDS ${CMAKE_BINARY_DIR}/manifest.txt
+        DEPENDS WebKit2
+        DEPENDS gtkdoc
+        COMMAND ${TOOLS_DIR}/gtk/make-dist.py
+                --check
+                --source-dir=${CMAKE_SOURCE_DIR}
+                --build-dir=${CMAKE_BINARY_DIR}
+                --version=${PROJECT_VERSION}
+                ${CMAKE_BINARY_DIR}/manifest.txt
+        COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
+    )
+endif ()
index ca6178f..985f127 100644 (file)
@@ -1,3 +1,21 @@
+2015-01-19  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [GTK] Generate the make dist manifest from a CMake template file
+        https://bugs.webkit.org/show_bug.cgi?id=139387
+
+        Reviewed by Martin Robinson.
+
+        Remove the code that performs variable substitution on manifest.txt.
+        Replace the custom variables used in that file with CMake variables.
+
+        * gtk/make-dist.py:
+        (Manifest.add_directory):
+        (Manifest.get_full_source_path):
+        (Manifest.process_line):
+        (Manifest.resolve_variables): Deleted.
+        (Manifest.get_full_tarball_path): Deleted.
+        * gtk/manifest.txt.in: Renamed from Tools/gtk/manifest.txt.
+
 2015-01-19  Brent Fulgham  <bfulgham@apple.com>
 
         [Win] Correct merge error in last commit.
index ce8f59a..a989b8b 100755 (executable)
@@ -159,27 +159,14 @@ class Manifest(object):
         self.current_directory = directory
         self.directories.append(directory)
 
-    def resolve_variables(self, string, strip=False):
-        if strip:
-            return string.replace('$source', '').replace('$build', '')
-
-        string = string.replace('$source', self.source_root)
-        if self.build_root:
-            string = string.replace('$build', self.build_root)
-        elif string.find('$build') != -1:
-            raise Exception('Manifest has $build but build root not given.')
-        return string
-
     def get_full_source_path(self, source_path):
-        full_source_path = self.resolve_variables(source_path)
-        if not os.path.exists(full_source_path):
-            full_source_path = os.path.join(self.source_root, source_path)
-        if not os.path.exists(full_source_path):
-            raise Exception('Could not find directory %s' % full_source_path)
-        return full_source_path
+        if not os.path.exists(source_path):
+            source_path = os.path.join(self.source_root, source_path)
+        if not os.path.exists(source_path):
+            raise Exception('Could not find directory %s' % source_path)
+        return source_path
 
     def get_full_tarball_path(self, path):
-        path = self.resolve_variables(path, strip=True)
         return self.tarball_root + path
 
     def get_source_and_tarball_paths_from_parts(self, parts):
@@ -202,9 +189,9 @@ class Manifest(object):
         elif parts[0] == "file" and len(parts) > 1:
             self.add_directory(File(*self.get_source_and_tarball_paths_from_parts(parts)))
         elif parts[0] == "exclude" and len(parts) > 1:
-            self.add_rule(Rule(Rule.Result.EXCLUDE, self.resolve_variables(parts[1])))
+            self.add_rule(Rule(Rule.Result.EXCLUDE, parts[1]))
         elif parts[0] == "include" and len(parts) > 1:
-            self.add_rule(Rule(Rule.Result.INCLUDE, self.resolve_variables(parts[1])))
+            self.add_rule(Rule(Rule.Result.INCLUDE, parts[1]))
 
     def should_skip_file(self, directory, filename):
         # Only allow files that are not in version control when they are explicitly included in the manifest from the build dir.
similarity index 94%
rename from Tools/gtk/manifest.txt
rename to Tools/gtk/manifest.txt.in
index d80f0b6..b8fff85 100644 (file)
@@ -102,5 +102,5 @@ file Tools/Scripts/webkit-build-directory
 file Tools/Scripts/webkitdirs.pm
 file Tools/jhbuild/jhbuildutils.py
 
-directory $build/Documentation/webkit2gtk/html Documentation/webkit2gtk/html
-directory $build/Documentation/webkitdomgtk/html Documentation/webkitdomgtk/html
+directory ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk/html Documentation/webkit2gtk/html
+directory ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk/html Documentation/webkitdomgtk/html