Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: third_party/closure_compiler/tools/create_include_gyp.py

Issue 2826693002: Fix create_include_gyp.py to support relative paths to include_js.gypi (Closed)
Patch Set: nits Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/closure_compiler/tools/create_include_gyp.py
diff --git a/third_party/closure_compiler/tools/create_include_gyp.py b/third_party/closure_compiler/tools/create_include_gyp.py
index 08ef52567ca24e3f77f94773dce6700c4f823a33..2febeb31f51b4cfdeadee9813ad063affbf2b56d 100755
--- a/third_party/closure_compiler/tools/create_include_gyp.py
+++ b/third_party/closure_compiler/tools/create_include_gyp.py
@@ -14,6 +14,9 @@ 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
@@ -33,15 +36,15 @@ _INCLUDE_TEMPLATE = """
_TARGET_TEMPLATE = """
{
'target_name': '%s',
- 'includes': ['../include_js.gypi'],
+ 'includes': ['%s'],
}"""
def CreateIncludeGyp(directory):
- include_dir = os.path.join(os.path.dirname(__file__), "..", directory)
- include_files = [f for f in os.listdir(include_dir) if f.endswith('.js')]
- include_files.sort()
- targets = [_TARGET_TEMPLATE % f[:-3] for f in include_files]
+ 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 = [_TARGET_TEMPLATE % (f[:-3], include_path) for f in js_files]
return _INCLUDE_TEMPLATE % (date.today().year, ",".join(targets).strip())
« no previous file with comments | « third_party/closure_compiler/interfaces/compiled_resources2.gyp ('k') | ui/file_manager/externs/compiled_resources2.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698