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

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
« no previous file with comments | « mojo/public/tools/bindings/generators/python_templates/module.py.tmpl ('k') | mojo/public/tools/gn/zip.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/mojom.gni
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni
index 6e50df7af9b285de36fd3b9ec85b02888293db88..d200dc80d4b726f00a43a7d56b2e967a76de83e9 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -127,6 +127,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"
rebased_mojo_sdk_public_deps = []
if (defined(invoker.mojo_sdk_public_deps)) {
@@ -213,6 +214,14 @@ template("mojom") {
if (defined(invoker.deps)) {
deps += invoker.deps
}
+ data_deps = [ ":${target_name}_python" ]
+ if (defined(invoker.mojo_sdk_deps)) {
+ foreach(sdk_dep, invoker.mojo_sdk_deps) {
+ # Check that the SDK dep was not mistakenly given as an absolute path.
+ assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
+ deps += [ rebase_path(sdk_dep, ".", mojo_root) ]
+ }
+ }
}
all_deps = rebased_mojo_sdk_deps + rebased_mojo_sdk_public_deps
@@ -237,6 +246,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")
« no previous file with comments | « mojo/public/tools/bindings/generators/python_templates/module.py.tmpl ('k') | mojo/public/tools/gn/zip.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698