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

Unified Diff: mojo/public/tools/bindings/mojom.gni

Issue 796373006: Content handler for python. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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: mojo/public/tools/bindings/mojom.gni
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni
index ebfeb7b5da32a6f285aba0c39aac691ca4ce1571..17bb8bfa600db6ba6a9a63f606da3c335bcc8f4c 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -108,6 +108,7 @@ template("mojom") {
generator_js_outputs = [ "{{source_gen_dir}}/{{source_name_part}}.mojom.js" ]
generator_python_outputs =
[ "{{source_gen_dir}}/{{source_name_part}}_mojom.py" ]
+ generator_python_zip_output = "$target_out_dir/$target_name.pyzip"
if (defined(invoker.visibility)) {
# Need to save this because the the target_name is overwritten inside the
@@ -189,6 +190,42 @@ template("mojom") {
}
}
+ action("${target_name}_python") {
+ script = rebase_path("mojo/public/tools/gn/zip.py", ".", mojo_root)
+
+ inputs = process_file_template(invoker.sources, generator_python_outputs)
+
+ deps = []
+ zip_inputs = []
+
+ foreach(d, all_deps) {
+ # Resolve the name, so that a target //mojo/something becomes
+ # //mojo/something:something and we can append "_python" to get the python
+ # dependency name.
+ full_name = get_label_info(d, "label_no_toolchain")
+ dep_name = get_label_info(d, "name")
+ dep_target_out_dir = get_label_info(d, "target_out_dir")
+ deps += [ "${full_name}_python" ]
+ zip_inputs += [ "$dep_target_out_dir/$dep_name.pyzip" ]
+ }
+
+ output = generator_python_zip_output
+ outputs = [
+ output,
+ ]
+
+ rebase_base_dir = rebase_path(target_gen_dir, root_build_dir)
+ rebase_inputs = rebase_path(inputs, root_build_dir)
+ rebase_zip_inputs = rebase_path(zip_inputs, root_build_dir)
+ rebase_output = rebase_path(output, root_build_dir)
+ args = [
+ "--base-dir=$rebase_base_dir",
+ "--inputs=$rebase_inputs",
+ "--zip-inputs=$rebase_zip_inputs",
+ "--output=$rebase_output",
+ ]
+ }
+
if (is_android) {
import("//build/config/android/rules.gni")

Powered by Google App Engine
This is Rietveld 408576698