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

Side by Side Diff: Source/build/scripts/scripts.gni

Issue 319983003: Work on blink GN bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//third_party/WebKit/Source/config.gni") 5 import("//third_party/WebKit/Source/config.gni")
6 6
7 # All paths in this file should be absolute so targets in any directory can use 7 # All paths in this file should be absolute so targets in any directory can use
8 # them without worrying about the current directory. 8 # them without worrying about the current directory.
9 _scripts_dir = "//third_party/WebKit/Source/build/scripts" 9 _scripts_dir = "//third_party/WebKit/Source/build/scripts"
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 _blink_gen_dir = "$root_gen_dir/blink" 78 _blink_gen_dir = "$root_gen_dir/blink"
79 _rel_blink_gen_dir = rebase_path(_blink_gen_dir, root_build_dir) 79 _rel_blink_gen_dir = rebase_path(_blink_gen_dir, root_build_dir)
80 80
81 # The GYP target make_core_generated has some deps and a bunch of actions on 81 # The GYP target make_core_generated has some deps and a bunch of actions on
82 # it, which means that the deps will be resolved before the actions run. Here 82 # it, which means that the deps will be resolved before the actions run. Here
83 # we have separate targets for each action. Its not clear which actions depend 83 # we have separate targets for each action. Its not clear which actions depend
84 # on these deps, so for GYP compatibility, all of the below actions should 84 # on these deps, so for GYP compatibility, all of the below actions should
85 # depend on the following deps. 85 # depend on the following deps.
86 make_core_generated_deps = [ 86 make_core_generated_deps = [
87 "//third_party/WebKit/Source/core:generated_testing_idls", 87 "//third_party/WebKit/Source/core:generated_testing_idls",
88 "//third_party/WebKit/Source/bindings:core_bindings_generated", 88 "//third_party/WebKit/Source/core:core_event_interfaces",
89 ] 89 ]
90 90
91 # Template to run most of scripts that process "*.in" files. 91 # Template to run most of scripts that process "*.in" files.
92 # script: script to run. 92 # script: script to run.
93 # in_files: ".in" files to pass to the script 93 # in_files: ".in" files to pass to the script
94 # other_inputs: (optional) other input files the script depends on 94 # other_inputs: (optional) other input files the script depends on
95 # defaults to "scripts_for_in_files" (if specified, we assume 95 # defaults to "scripts_for_in_files" (if specified, we assume
96 # that the contents of "scripts_for_in_files" are included in 96 # that the contents of "scripts_for_in_files" are included in
97 # this list specified since this is how these lists are filled 97 # this list specified since this is how these lists are filled
98 # from the GYP build. 98 # from the GYP build.
99 # outputs: expected results relative to the blink_gen_dir 99 # outputs: expected results
100 # other_args: (optional) other arguements to pass to the script. 100 # other_args: (optional) other arguements to pass to the script.
101 template("process_in_files") { 101 template("process_in_files") {
102 action(target_name) { 102 action(target_name) {
103 script = invoker.script 103 script = invoker.script
104 104
105 source_prereqs = invoker.in_files 105 source_prereqs = invoker.in_files
106 if (defined(invoker.other_inputs)) { 106 if (defined(invoker.other_inputs)) {
107 source_prereqs += invoker.other_inputs 107 source_prereqs += invoker.other_inputs
108 } else { 108 } else {
109 source_prereqs += scripts_for_in_files 109 source_prereqs += scripts_for_in_files
110 } 110 }
111 outputs = rebase_path(invoker.outputs, ".", _blink_gen_dir) 111 outputs = invoker.outputs
112 112
113 args = rebase_path(invoker.in_files, root_build_dir) + [ 113 args = rebase_path(invoker.in_files, root_build_dir) + [
114 "--output_dir", _rel_blink_gen_dir, 114 "--output_dir", _rel_blink_gen_dir,
115 ] 115 ]
116 if (defined(invoker.other_args)) { 116 if (defined(invoker.other_args)) {
117 args += invoker.other_args 117 args += invoker.other_args
118 } 118 }
119 119
120 deps = make_core_generated_deps 120 deps = make_core_generated_deps
121 } 121 }
122 } 122 }
123 123
124 # Template to run the make_names script. This is a special case of 124 # Template to run the make_names script. This is a special case of
125 # process_in_files. 125 # process_in_files.
126 # in_files: files to pass to the script 126 # in_files: files to pass to the script
127 # outputs: expected results relative to the blink_gen_dir 127 # outputs: expected results
128 template("make_names") { 128 template("make_names") {
129 process_in_files(target_name) { 129 process_in_files(target_name) {
130 script = "//third_party/WebKit/Source/build/scripts/make_names.py" 130 script = "//third_party/WebKit/Source/build/scripts/make_names.py"
131 in_files = invoker.in_files 131 in_files = invoker.in_files
132 other_inputs = make_names_files 132 other_inputs = make_names_files
133 outputs = invoker.outputs 133 outputs = invoker.outputs
134 other_args = [ "--defines", feature_defines_string ] 134 other_args = [ "--defines", feature_defines_string ]
135 } 135 }
136 } 136 }
137 137
138 # Template to run the make_qualified_names script. This is a special case of 138 # Template to run the make_qualified_names script. This is a special case of
139 # process_in_files. 139 # process_in_files.
140 # in_files: list of ".in" files to process. 140 # in_files: list of ".in" files to process.
141 # outputs: list of output files relative to blink_gen_dir. 141 # outputs: list of output files
142 template("make_qualified_names") { 142 template("make_qualified_names") {
143 process_in_files(target_name) { 143 process_in_files(target_name) {
144 script = "//third_party/WebKit/Source/build/scripts/make_qualified_names.py" 144 script = "//third_party/WebKit/Source/build/scripts/make_qualified_names.py"
145 in_files = invoker.in_files 145 in_files = invoker.in_files
146 other_inputs = make_qualified_names_files 146 other_inputs = make_qualified_names_files
147 outputs = invoker.outputs 147 outputs = invoker.outputs
148 other_args = [ "--defines", feature_defines_string ] 148 other_args = [ "--defines", feature_defines_string ]
149 } 149 }
150 } 150 }
151 151
152 # Calls the make_event_factory script. This is a special case of 152 # Calls the make_event_factory script. This is a special case of
153 # process_in_files. 153 # process_in_files.
154 # in_files: list of ".in" files to process. 154 # in_files: list of ".in" files to process.
155 # outputs: list of output files relative to blink_gen_dir. 155 # outputs: list of output files
156 template("make_event_factory") { 156 template("make_event_factory") {
157 process_in_files(target_name) { 157 process_in_files(target_name) {
158 script = "//third_party/WebKit/Source/build/scripts/make_event_factory.py" 158 script = "//third_party/WebKit/Source/build/scripts/make_event_factory.py"
159 in_files = invoker.in_files 159 in_files = invoker.in_files
160 other_inputs = make_event_factory_files 160 other_inputs = make_event_factory_files
161 outputs = invoker.outputs 161 outputs = invoker.outputs
162 } 162 }
163 } 163 }
164 164
165 # Calls the make_token_matcher script. 165 # Calls the make_token_matcher script.
166 # input_file: The "*-in.cpp" file 166 # input_file: The "*-in.cpp" file
167 # output_file: The output file (relative to the build_gen_dir) 167 # output_file: The output file
168 template("make_token_matcher") { 168 template("make_token_matcher") {
169 action(target_name) { 169 action(target_name) {
170 script = "//third_party/WebKit/Source/build/scripts/make_token_matcher.py" 170 script = "//third_party/WebKit/Source/build/scripts/make_token_matcher.py"
171 171
172 source_prereqs = scripts_for_in_files + [ invoker.input_file ] 172 source_prereqs = scripts_for_in_files + [ invoker.input_file ]
173 outputs = [ 173 outputs = [ invoker.output_file ]
174 rebase_path(invoker.output_file, ".", _blink_gen_dir)
175 ]
176 174
177 args = [ 175 args = [
178 rebase_path(invoker.input_file, root_build_dir), 176 rebase_path(invoker.input_file, root_build_dir),
179 rebase_path(invoker.output_file, root_build_dir, _blink_gen_dir), 177 rebase_path(invoker.output_file, root_build_dir, _blink_gen_dir),
180 ] 178 ]
181 179
182 deps = make_core_generated_deps 180 deps = make_core_generated_deps
183 } 181 }
184 } 182 }
185 183
186 # Calls generate_event_interfaces
187 # sources: A list of IDL files to process.
188 # output_file: The .in file to write, relative to the blink_gen_dir.
189 # suffix: (Optional) String to be passed to script via --suffix
190 template("generate_event_interfaces") {
191 action(target_name) {
192 # Write the file list to a unique temp file to avoid blowing out the
193 # command line length limit.
194 idl_files_list = "$target_gen_dir/${target_name}_file_list.tmp"
195 write_file(idl_files_list,
196 rebase_path(invoker.sources, root_build_dir))
197
198 source_prereqs = [
199 "//third_party/WebKit/Source/bindings/scripts/utilities.py",
200 idl_files_list,
201 ] + invoker.sources
202
203 output_file = "$_blink_gen_dir/" + invoker.output_file
204 outputs = [ output_file ]
205
206 script = "//third_party/WebKit/Source/bindings/scripts/generate_event_interf aces.py"
207 args = [
208 "--event-idl-files-list",
209 rebase_path(idl_files_list, root_build_dir),
210 "--event-interfaces-file",
211 rebase_path(output_file, root_build_dir),
212 "--write-file-only-if-changed=1", # Always true for Ninja.
213 ]
214
215 if (defined(invoker.suffix)) {
216 args += [ "--suffix", invoker.suffix ]
217 }
218 }
219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698