2 # Copyright %d The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
8 # cd third_party/closure_compiler
9 # tools/create_externs_gyp.py > externs/compiled_resources.gyp
11 from datetime
import date
15 _EXTERNS_TEMPLATE
= """
16 # Copyright %d The Chromium Authors. All rights reserved.
17 # Use of this source code is governed by a BSD-style license that can be
18 # found in the LICENSE file.
20 ########################################################
21 # NOTE: THIS FILE IS GENERATED. DO NOT EDIT IT! #
22 # Instead, run create_externs_gyp.py to regenerate it. #
23 ########################################################
31 _TARGET_TEMPLATE
= """
34 'includes': ['../externs_js.gypi'],
38 def CreateExternsGyp():
39 externs_dir
= os
.path
.join(os
.path
.dirname(__file__
), "..", "externs")
40 externs_files
= [f
for f
in os
.listdir(externs_dir
) if f
.endswith('.js')]
42 targets
= [_TARGET_TEMPLATE
% f
[:-3] for f
in externs_files
]
43 return _EXTERNS_TEMPLATE
% (date
.today().year
, ",".join(targets
).strip())
46 if __name__
== "__main__":
47 print CreateExternsGyp()