From 16570463ab8d3bb22187d53200514d92d2a59541 Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Wed, 14 Jan 2015 16:27:42 -0800 Subject: [PATCH] Add buck build soyc to output GWT split point report The GWT compiler can output a report (or "story of your compile"), describing the size of the JavaScript and which source classes contributed to the overall download size. This is useful for optimizing code splits in Dispatcher, and generally understanding the impact of linking code together. Only the "Split Point Report" is created. The "Compiler Metrics" are not output. The report is very slow to create, so it is not done by default. Change-Id: I6ce86d65ee5f3e4bdba573d1f777ccc59767341d --- .buckconfig | 1 + .gitignore | 1 + Documentation/dev-buck.txt | 20 ++++++++++++++++++++ gerrit-gwtui/BUCK | 11 +++++++++++ 4 files changed, 33 insertions(+) diff --git a/.buckconfig b/.buckconfig index 1bf9b3689d..e4a19f1ade 100644 --- a/.buckconfig +++ b/.buckconfig @@ -11,6 +11,7 @@ gerrit = //:gerrit release = //:release safari = //:safari + soyc = //gerrit-gwtui:ui_soyc withdocs = //:withdocs [buildfile] diff --git a/.gitignore b/.gitignore index b356144211..c30cee65d1 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ /.buckd /buck-cache /buck-out +/extras /local.properties *.pyc /gwt-unitCache diff --git a/Documentation/dev-buck.txt b/Documentation/dev-buck.txt index fb04bf418a..6bd3905dfb 100644 --- a/Documentation/dev-buck.txt +++ b/Documentation/dev-buck.txt @@ -231,6 +231,26 @@ The WAR file will be placed in: buck-out/gen/withdocs.war ---- +[[soyc]] +=== GWT Compile Report + +The GWT compiler can output a compile report (or "story of your compile"), +describing the size of the JavaScript and which source classes contributed +to the overall download size. + +---- + buck build soyc +---- + +The report will be written as an HTML page to the extras directory, and +can be opened and viewed in any web browser: + +---- + extras/gerrit_ui/soycReport/compile-report/index.html +---- + +Only the "Split Point Report" is created, "Compiler Metrics" are not output. + [[release]] === Gerrit Release WAR File diff --git a/gerrit-gwtui/BUCK b/gerrit-gwtui/BUCK index d50c6e73eb..aad5e0b5fd 100644 --- a/gerrit-gwtui/BUCK +++ b/gerrit-gwtui/BUCK @@ -36,6 +36,17 @@ gwt_binary( vm_args = GWT_JVM_ARGS, ) +gwt_binary( + name = 'ui_soyc', + modules = [MODULE], + module_deps = [':ui_module'], + deps = DEPS + [':ui_dbg'], + local_workers = cpu_count(), + strict = True, + experimental_args = GWT_COMPILER_ARGS + ['-compileReport'], + vm_args = GWT_JVM_ARGS, +) + gwt_binary( name = 'ui_dbg', modules = [MODULE],