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

Side by Side Diff: components/webui_generator/generator/export_h.py

Issue 1181703008: Removed webui_generator and new OOBE UI placeholder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed empty line. Created 5 years, 6 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import datetime
6 import util
7 import os
8
9 H_FILE_TEMPLATE = \
10 """// Copyright %(year)d The Chromium Authors. All rights reserved.
11 // Use of this source code is governed by a BSD-style license that can be
12 // found in the LICENSE file.
13
14 // NOTE: this file is generated from "%(source)s". Do not modify directly.
15
16 #ifndef %(include_guard)s
17 #define %(include_guard)s
18
19 #if defined(COMPONENT_BUILD)
20
21 #if defined(WIN32)
22
23 #if defined(%(impl_macro)s)
24 #define %(export_macro)s __declspec(dllexport)
25 #else
26 #define %(export_macro)s __declspec(dllimport)
27 #endif // defined(%(impl_macro)s)
28
29 #else // defined(WIN32)
30
31 #if defined(%(impl_macro)s)
32 #define %(export_macro)s __attribute__((visibility("default")))
33 #else
34 #define %(export_macro)s
35 #endif // defined(%(impl_macro)s)
36
37 #endif // defined(WIN32)
38
39 #else // defined(COMPONENT_BUILD)
40
41 #define %(export_macro)s
42
43 #endif
44
45 #endif // %(include_guard)s
46 """
47
48 def GenHFile(declaration):
49 subs = {}
50 subs['year'] = datetime.date.today().year
51 subs['source'] = declaration.path
52 subs['include_guard'] = util.PathToIncludeGuard(
53 declaration.export_h_include_path)
54 subs['export_macro'] = declaration.component_export_macro
55 subs['impl_macro'] = declaration.component_impl_macro
56 return H_FILE_TEMPLATE % subs
57
58 def ListOutputs(declaration, destination):
59 dirname = os.path.join(destination, os.path.dirname(declaration.path))
60 h_file_path = os.path.join(dirname, declaration.export_h_name)
61 return [h_file_path]
62
63 def Gen(declaration, destination):
64 h_file_path = ListOutputs(declaration, destination)[0]
65 util.CreateDirIfNotExists(os.path.dirname(h_file_path))
66 open(h_file_path, 'w').write(GenHFile(declaration))
OLDNEW
« no previous file with comments | « components/webui_generator/generator/declaration.py ('k') | components/webui_generator/generator/gen_sources.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698