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

Issue 2171033002: [mojo] Allow bindings generation with explicit relative include paths (Closed)

Created:
4 years, 5 months ago by Luis Héctor Chávez
Modified:
4 years, 4 months ago
Reviewers:
yzshen1
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/a/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[mojo] Allow bindings generation with explicit relative include paths If an imported mojo module AND its target directory are located outside of the normal tree structure from the rest of the files, it will cause the generated code to have a different-than-expected include path. This change allows each -I directive to have an optional 'depth' modifier so that all paths are correctly relativized. Omitting the modifier is a no-op and preserves current behavior. Example scenario: project_a/src/A.mojom project_b/src/B.mojom (import "A.mojom") mojom_bindings_generator.py \ -g c++ \ -d project_a/src \ -o project_a/gen \ project_a/src/A.mojom # Normal invocation mojom_bindings_generator.py \ -I project_a/src \ -g c++ \ -d project_b/src \ -o project_b/gen \ project_b/src/B.mojom # This causes A's generated import to be # "../../../project_a/src/A.mojom.h" mojom_bindings_generator.py \ -I project_a/src:project_a/src \ -g c++ \ -d project_b/src \ -o project_b/gen \ project_b/src/B.mojom # The addition of the depth modified to the include # causes A's generated import to be "A.mojom.h" Committed: https://crrev.com/6f8d0b04f777a8cc17d0c214100cf6b74d24f654 Cr-Commit-Position: refs/heads/master@{#407914}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Addressed review comments #

Patch Set 3 : Ensured zero changes in Chromium checkout #

Total comments: 6

Patch Set 4 : Missed one source_root usage #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -36 lines) Patch
M mojo/public/tools/bindings/mojom_bindings_generator.py View 1 2 3 6 chunks +64 lines, -36 lines 0 comments Download

Messages

Total messages: 28 (18 generated)
yzshen1
https://codereview.chromium.org/2171033002/diff/1/mojo/public/tools/bindings/mojom_bindings_generator.py File mojo/public/tools/bindings/mojom_bindings_generator.py (right): https://codereview.chromium.org/2171033002/diff/1/mojo/public/tools/bindings/mojom_bindings_generator.py#newcode85 mojo/public/tools/bindings/mojom_bindings_generator.py:85: return os.path.join(dir_name, file_name), None According to our discussion, I ...
4 years, 5 months ago (2016-07-21 23:21:52 UTC) #2
Luis Héctor Chávez
https://codereview.chromium.org/2171033002/diff/1/mojo/public/tools/bindings/mojom_bindings_generator.py File mojo/public/tools/bindings/mojom_bindings_generator.py (right): https://codereview.chromium.org/2171033002/diff/1/mojo/public/tools/bindings/mojom_bindings_generator.py#newcode85 mojo/public/tools/bindings/mojom_bindings_generator.py:85: return os.path.join(dir_name, file_name), None On 2016/07/21 23:21:51, yzshen1 wrote: ...
4 years, 5 months ago (2016-07-21 23:33:13 UTC) #5
yzshen1
https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py File mojo/public/tools/bindings/mojom_bindings_generator.py (right): https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py#newcode224 mojo/public/tools/bindings/mojom_bindings_generator.py:224: args.import_directories[idx] = RelativePath(tokens[0], args.depth) I am confused, args.depth is ...
4 years, 5 months ago (2016-07-22 23:38:10 UTC) #13
Luis Héctor Chávez
https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py File mojo/public/tools/bindings/mojom_bindings_generator.py (right): https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py#newcode224 mojo/public/tools/bindings/mojom_bindings_generator.py:224: args.import_directories[idx] = RelativePath(tokens[0], args.depth) On 2016/07/22 23:38:10, yzshen1 wrote: ...
4 years, 5 months ago (2016-07-25 21:00:22 UTC) #15
yzshen1
One more comment. Thanks! https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py File mojo/public/tools/bindings/mojom_bindings_generator.py (right): https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py#newcode147 mojo/public/tools/bindings/mojom_bindings_generator.py:147: RelativePath(dirname, args.depth), import_data['filename'], Is it ...
4 years, 4 months ago (2016-07-26 18:35:26 UTC) #16
Luis Héctor Chávez
https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py File mojo/public/tools/bindings/mojom_bindings_generator.py (right): https://codereview.chromium.org/2171033002/diff/40001/mojo/public/tools/bindings/mojom_bindings_generator.py#newcode147 mojo/public/tools/bindings/mojom_bindings_generator.py:147: RelativePath(dirname, args.depth), import_data['filename'], On 2016/07/26 18:35:26, yzshen1 wrote: > ...
4 years, 4 months ago (2016-07-26 19:50:02 UTC) #18
yzshen1
LGTM Thanks for patience.
4 years, 4 months ago (2016-07-26 19:51:25 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2171033002/60001
4 years, 4 months ago (2016-07-26 21:05:21 UTC) #24
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 4 months ago (2016-07-26 21:10:21 UTC) #26
commit-bot: I haz the power
4 years, 4 months ago (2016-07-26 21:13:28 UTC) #28
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/6f8d0b04f777a8cc17d0c214100cf6b74d24f654
Cr-Commit-Position: refs/heads/master@{#407914}

Powered by Google App Engine
This is Rietveld 408576698