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

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 38eb391157ec8099e3038e0f2c592172a0486a4f..c358bb05d0b4b5fc6a0a46dd3930e7de49d11ac9 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -124,6 +124,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
@@ -219,6 +220,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