summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortommycli <tommycli@chromium.org>2016-03-25 15:07:18 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 22:09:38 +0000
commit521de10fba02c37a5221a70a29a9e53fe478733c (patch)
tree14a387ef3656a8fb19874eece27aa7deffc3f0f0
parent12c8005e13fb59b925f5c9fddec7b4edbcf35a5a (diff)
downloadchromium_src-521de10fba02c37a5221a70a29a9e53fe478733c.zip
chromium_src-521de10fba02c37a5221a70a29a9e53fe478733c.tar.gz
chromium_src-521de10fba02c37a5221a70a29a9e53fe478733c.tar.bz2
Closure Compiler: Add script to run compile and update Wiki docs.
This patch adds a script to run the Closure Compile for Chrome resources. It also updates the wiki to reflect this. BUG=596944 Review URL: https://codereview.chromium.org/1829553002 Cr-Commit-Position: refs/heads/master@{#383378}
-rw-r--r--docs/closure_compilation.md21
-rw-r--r--third_party/closure_compiler/compiled_resources.gyp2
-rw-r--r--third_party/closure_compiler/compiled_resources2.gyp2
-rwxr-xr-xthird_party/closure_compiler/run_compiler16
4 files changed, 22 insertions, 19 deletions
diff --git a/docs/closure_compilation.md b/docs/closure_compilation.md
index 540abf6..bc1cabd 100644
--- a/docs/closure_compilation.md
+++ b/docs/closure_compilation.md
@@ -15,17 +15,10 @@ On Mac or Windows, visit:
### Using ninja to compile the code
-We use GYP and ninja as our build system. To generate the ninja files from GYP:
+To compile the JavaScript, run this script:
```shell
-# notice the 2 in compiled_resources2.gyp
-GYP_GENERATORS=ninja tools/gyp/gyp --depth . third_party/closure_compiler/compiled_resources2.gyp
-```
-
-To compile the JavaScript:
-
-```shell
-ninja -C out/Default -j4
+third_party/closure_compiler/run_compiler
```
The output should look something like this:
@@ -35,16 +28,10 @@ ninja: Entering directory `out/Default/'
[30/106] ACTION Compiling chrome/browser/resources/md_history/constants.js
```
-To generate and run the **deprecated** v1 gyp format, remove the "2" from "compiled_resources2.gyp":
-
-```shell
-$ GYP_GENERATORS=ninja tools/gyp/gyp --depth . third_party/closure_compiler/compiled_resources.gyp
-```
-
-Compiling works the same way for both v1 and v2 systems:
+To compile only a specific target, add an argument after the script name:
```shell
-ninja -C out/Default -j4
+third_party/closure_compiler/run_compiler people_page
```
## Background
diff --git a/third_party/closure_compiler/compiled_resources.gyp b/third_party/closure_compiler/compiled_resources.gyp
index c57dae7..82075d9 100644
--- a/third_party/closure_compiler/compiled_resources.gyp
+++ b/third_party/closure_compiler/compiled_resources.gyp
@@ -17,7 +17,7 @@
{
'targets': [
{
- 'target_name': 'compile_all_resources',
+ 'target_name': 'compiled_resources',
'type': 'none',
'dependencies': [
'../../chrome/browser/resources/bookmark_manager/js/compiled_resources.gyp:*',
diff --git a/third_party/closure_compiler/compiled_resources2.gyp b/third_party/closure_compiler/compiled_resources2.gyp
index df46c0c..da54f9f 100644
--- a/third_party/closure_compiler/compiled_resources2.gyp
+++ b/third_party/closure_compiler/compiled_resources2.gyp
@@ -11,7 +11,7 @@
{
'targets': [
{
- 'target_name': 'compile_all_resources',
+ 'target_name': 'compiled_resources2',
'type': 'none',
'dependencies': [
'<(DEPTH)/chrome/browser/resources/chromeos/braille_ime/compiled_resources2.gyp:*',
diff --git a/third_party/closure_compiler/run_compiler b/third_party/closure_compiler/run_compiler
new file mode 100755
index 0000000..884c415
--- /dev/null
+++ b/third_party/closure_compiler/run_compiler
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+set -e
+
+cd $(dirname "$0")/../..
+
+export GYP_GENERATORS="ninja"
+
+tools/gyp/gyp --no-circular-check \
+third_party/closure_compiler/compiled_resources.gyp \
+third_party/closure_compiler/compiled_resources2.gyp
+
+ninja -C out/Default -j4 $@