[EFL][CMAKE] Compress resource files of inspector
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2013 18:37:54 +0000 (18:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2013 18:37:54 +0000 (18:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=106210

Patch by Seokju Kwon <seokju.kwon@gmail.com> on 2013-01-17
Reviewed by Gyuyoung Kim.

Add compressing JavaScript
for smaller package and faster connection of remote web inspector.

* Source/PlatformEfl.cmake:

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

ChangeLog
Source/PlatformEfl.cmake

index 64c0d56..7d07525 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2013-01-17  Seokju Kwon  <seokju.kwon@gmail.com>
+
+        [EFL][CMAKE] Compress resource files of inspector
+        https://bugs.webkit.org/show_bug.cgi?id=106210
+
+        Reviewed by Gyuyoung Kim.
+
+        Add compressing JavaScript
+        for smaller package and faster connection of remote web inspector.
+
+        * Source/PlatformEfl.cmake:
+
 2013-01-16  Hugo Parente Lima  <hugo.lima@openbossa.org>
 
         [CMake] Report actual values for feature configuration (instead of the default)
index caac104..bab370b 100644 (file)
@@ -17,4 +17,22 @@ if (ENABLE_INSPECTOR)
                        PATTERN "*.css"
                        PATTERN "*.gif"
                        PATTERN "*.png")
+
+    find_program(UGLIFYJS_EXECUTABLE uglifyjs)
+    if (UGLIFYJS_EXECUTABLE AND (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug"))
+        file(GLOB frontend_js_files "${WEBCORE_DIR}/inspector/front-end/*.js")
+        set(all_js_files
+            ${frontend_js_files}
+            "${WEBCORE_DIR}/English.lproj/localizedStrings.js"
+            "${DERIVED_SOURCES_WEBCORE_DIR}/InspectorBackendCommands.js"
+        )
+
+        foreach (js_file ${all_js_files})
+            get_filename_component(filename ${js_file} NAME)
+            install(CODE
+                "execute_process(
+                    COMMAND ${UGLIFYJS_EXECUTABLE} --overwrite ${filename}
+                    WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${WEB_INSPECTOR_DIR})")
+        endforeach ()
+    endif ()
 endif ()