Commit 55555202 authored by Christopher Lam's avatar Christopher Lam Committed by Commit Bot

Remove all remaining GYP Closure Compilation.

See go/closure-compile-gn for details.

This CL removes all remaining traces of GYP Closure Compilation. This
includes:
- all compiled_resources2.gyp files from ui/webui
- all PRESUBMITs that add the closure_compilation bot
- the closure_compilation bot in all build systems
- some GYP tooling that is only used for closure compilation builders

TBR=sashab@chromium.org

Bug: 632206
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: Ief58c91d43ed859d5b4022dd30e7d5507dd7909b
Reviewed-on: https://chromium-review.googlesource.com/1051144
Commit-Queue: calamity <calamity@chromium.org>
Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576368}
parent c740def6
......@@ -138,12 +138,3 @@ def CheckChangeOnUpload(input_api, output_api):
def CheckChangeOnCommit(input_api, output_api):
return _CheckChangeOnUploadOrCommit(input_api, output_api)
def PostUploadHook(cl, change, output_api):
return output_api.EnsureCQIncludeTrybotsAreAdded(
cl,
[
'luci.chromium.try:closure_compilation',
],
'Automatically added optional Closure bots to run on CQ.')
# Copyright 2015 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.
{
'type': 'none',
'variables': {
'CLOSURE_DIR': '<(DEPTH)/third_party/closure_compiler',
'EXTERNS_GYP': '<(CLOSURE_DIR)/externs/compiled_resources2.gyp',
'INTERFACES_GYP': '<(CLOSURE_DIR)/interfaces/compiled_resources2.gyp',
'default_source_file': '<(_target_name).js',
'source_files%': ['<(default_source_file)'],
'extra_inputs%': [],
'includes': ['closure_args.gypi'],
},
'sources': ['<@(source_files)'],
'all_dependent_settings': {
'sources': ['<@(source_files)'],
},
'actions': [
{
'action_name': 'compile_js',
# This action optionally takes these arguments:
# - sources: a list of all of the source files to be compiled.
# If sources is undefined, a default of ['<(_target_name).js']
# is created (this probably suffices for many targets).
# - out_file: a file where the compiled output is written to. The default
# is gen/closure/<path to |target_name|>/|target_name|.js.
# - script_args: additional arguments to pass to compile2.py.
# - closure_args: additional arguments to pass to the Closure compiler.
# - disabled_closure_args: additional arguments dealing with the
# strictness of compilation; Non-strict
# defaults are provided that can be overriden.
'variables': {
'target_path': '<!(python <(CLOSURE_DIR)/build/outputs.py <(default_source_file))',
'out_file%': '<(SHARED_INTERMEDIATE_DIR)/closure/<(target_path)',
# TODO(dbeam): remove when no longer used from remoting/.
'script_args%': [],
'closure_args%': '<(default_closure_args)',
'disabled_closure_args%': '<(default_disabled_closure_args)',
},
'inputs': [
'<(CLOSURE_DIR)/build/outputs.py',
'<(CLOSURE_DIR)/closure_args.gypi',
'<(CLOSURE_DIR)/compile2.py',
'<(CLOSURE_DIR)/compile_js2.gypi',
'<(CLOSURE_DIR)/compiler/compiler.jar',
'<(CLOSURE_DIR)/include_js.gypi',
'<(CLOSURE_DIR)/processor.py',
'>@(_sources)',
# When converting to GN, write the paths to additional inputs in a GN
# depfile file instead.
'<@(extra_inputs)',
],
'outputs': ['<(out_file)'],
'action': [
'python',
'<(CLOSURE_DIR)/compile2.py',
'<@(script_args)',
'>@(_sources)',
'--out_file', '<(out_file)',
'--closure_args', '<@(closure_args)', '<@(disabled_closure_args)',
# '--verbose' # for make glorious log spam of Closure compiler.
],
'message': 'Compiling <(target_path)',
},
],
}
# Copyright 2015 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.
#
# Add your directory-specific .gyp file to this list for it to be continuously
# typechecked on the builder:
# http://build.chromium.org/p/chromium.fyi/builders/Closure%20Compilation%20Linux
#
# Also, see our guide to Closure compilation in chrome:
# https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
{
'targets': [
{
'target_name': 'compiled_resources2',
'type': 'none',
'dependencies': [
],
},
]
}
# Copyright 2015 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.
{
'type': 'none',
'all_dependent_settings': {
'sources': ['<(_target_name).js'],
},
}
#!/bin/bash
# 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
readonly SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
cd "$SCRIPT_DIR/../.." # src/.
export GYP_GENERATORS="ninja"
tools/gyp/gyp --no-circular-check third_party/closure_compiler/compiled_resources2.gyp
os_name=`uname -s`
cores_count=1
case "$os_name" in
"Darwin") cores_count=`sysctl -n hw.ncpu` ;;
"Linux") cores_count=`nproc` ;;
esac
ninja -C out/Default -j $cores_count $@
#!/usr/bin/env python
# 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.
#
# Usage:
#
# cd third_party/closure_compiler
# tools/create_include_gyp.py externs > externs/compiled_resources2.gyp
# tools/create_include_gyp.py interfaces > interfaces/compiled_resources2.gyp
from datetime import date
import os
import sys
_INCLUDE_GYPI = os.path.join(os.path.dirname(__file__), '..', 'include_js.gypi')
_INCLUDE_TEMPLATE = """
# Copyright %d 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.
########################################################
# NOTE: THIS FILE IS GENERATED. DO NOT EDIT IT! #
# Instead, run create_include_gyp.py to regenerate it. #
########################################################
{
'targets': [
%s,
],
}""".lstrip()
_TARGET_TEMPLATE_NO_CHROME_DEPENDENCY = """
{
'target_name': '%s',
'includes': ['%s'],
}"""
_TARGET_TEMPLATE = """
{
'target_name': '%s',
'dependencies': ['chrome'],
'includes': ['%s'],
}"""
# Add externs files that do not depend on chrome.* namespace here. Everything
# else will have chrome.js as a dependency.
NO_CHROME_DEPENDENCY = set([
'chrome.js',
'mojo.js',
'pending.js',
'polymer-1.0.js',
'web_animations.js',
])
def CreateIncludeGyp(directory):
include_path = os.path.normpath(os.path.relpath(_INCLUDE_GYPI, directory))
js_files = [f for f in os.listdir(directory) if f.endswith('.js')]
js_files.sort()
targets = []
for f in js_files:
template = (_TARGET_TEMPLATE_NO_CHROME_DEPENDENCY if f in
NO_CHROME_DEPENDENCY else _TARGET_TEMPLATE)
targets.append(template % (f[:-3], include_path))
return _INCLUDE_TEMPLATE % (date.today().year, ",".join(targets).strip())
def ShowUsageAndDie():
print "usage: tools/create_include_gyp.py externs/ > externs/compiled_resources2.gyp"
sys.exit(1)
if __name__ == "__main__":
if len(sys.argv) != 2:
ShowUsageAndDie()
print CreateIncludeGyp(sys.argv[1])
......@@ -2,15 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def PostUploadHook(cl, change, output_api):
return output_api.EnsureCQIncludeTrybotsAreAdded(
cl,
[
'luci.chromium.try:closure_compilation',
],
'Automatically added optional Closure bots to run on CQ.')
def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)
......
# 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.
{
'variables': {
'closure_args': [
'<@(default_closure_args)',
'warning_level=VERBOSE',
],
},
'dependencies': [
'<(EXTERNS_GYP):file_manager_private'
],
'includes': ['../../third_party/closure_compiler/compile_js2.gypi'],
}
......@@ -4,15 +4,6 @@
import os
def PostUploadHook(cl, change, output_api):
return output_api.EnsureCQIncludeTrybotsAreAdded(
cl,
[
'luci.chromium.try:closure_compilation',
],
'Automatically added optional Closure bots to run on CQ.')
def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)
......@@ -20,30 +11,6 @@ def CheckChangeOnUpload(input_api, output_api):
def CheckChangeOnCommit(input_api, output_api):
return _CommonChecks(input_api, output_api)
# For every modified gyp file, warn if the corresponding GN file is not updated.
def _CheckForGNUpdate(input_api, output_api):
gyp_folders = set()
for f in input_api.AffectedFiles():
local_path = f.LocalPath()
if local_path.endswith('compiled_resources2.gyp'):
gyp_folders.add(os.path.dirname(local_path))
for f in input_api.AffectedFiles():
local_path = f.LocalPath()
dir_name = os.path.dirname(local_path)
if local_path.endswith('BUILD.gn') and dir_name in gyp_folders:
gyp_folders.remove(dir_name)
if not gyp_folders:
return []
return [output_api.PresubmitPromptWarning("""
You may have forgotten to update the BUILD.gn Closure Compilation for the
following folders:
""" + "\n".join(["- " + x for x in gyp_folders]) + """
Ping calamity@ or check go/closure-compile-gn for more details.
""")]
def _CheckForTranslations(input_api, output_api):
shared_keywords = ['i18n(']
......@@ -86,7 +53,6 @@ translation from the place using the shared code. For an example: see
def _CommonChecks(input_api, output_api):
results = []
results += _CheckForTranslations(input_api, output_api)
results += _CheckForGNUpdate(input_api, output_api)
results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api,
check_js=True)
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment