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

Issue 14905002: Use jinja2 templating engine for Python code generators (Closed)

Created:
7 years, 7 months ago by Timothy Loh
Modified:
7 years, 7 months ago
CC:
blink-reviews, abarth-chromium, eseidel
Base URL:
https://chromium.googlesource.com/chromium/blink@master
Visibility:
Public.

Description

Use jinja2 templating engine for Python code generators Instead of manually building C++ source files, we can use a templating engine like jinja2. This should make it easier to add new code generators and edit existing ones. Comparing the output from the templates here and the previous generators, the only differences are minor whitespace changes (http://pastebin.com/XPicZmPk), for the sake of making the templates more readable. BUG=

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -118 lines) Patch
M Source/core/core.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/core.gyp/core_derived_sources.gyp View 2 chunks +3 lines, -0 lines 0 comments Download
A Source/core/dom/EventFactory.cpp.tmpl View 1 chunk +26 lines, -0 lines 0 comments Download
A Source/core/page/RuntimeEnabledFeatures.cpp.tmpl View 1 chunk +16 lines, -0 lines 0 comments Download
A Source/core/page/RuntimeEnabledFeatures.h.tmpl View 1 chunk +44 lines, -0 lines 0 comments Download
M Source/core/scripts/make_event_factory.py View 2 chunks +11 lines, -39 lines 1 comment Download
M Source/core/scripts/make_runtime_features.py View 4 chunks +9 lines, -65 lines 0 comments Download
A + Source/core/scripts/template_expander.py View 2 chunks +18 lines, -14 lines 2 comments Download
A Source/core/scripts/templates/macros.tmpl View 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Timothy Loh
7 years, 7 months ago (2013-05-03 07:51:47 UTC) #1
eseidel
I don't speak jinja very well. But this seems reasonable. I'll chat with abarth tomorrow ...
7 years, 7 months ago (2013-05-06 00:39:04 UTC) #2
abarth-chromium
Nice! This looks much better than hand-rolling our templates. My main comment is about how ...
7 years, 7 months ago (2013-05-06 18:27:32 UTC) #3
abarth-chromium
+haraken as an FYI. We might consider using something like this in the bindings code ...
7 years, 7 months ago (2013-05-06 18:28:54 UTC) #4
eseidel
other than abarth's complaints this looks totally reasonable. Thank you for working on this!
7 years, 7 months ago (2013-05-08 01:22:54 UTC) #5
eseidel
Looks very reasonable. Assuming this generates the same output as the current scripts, lgtm.
7 years, 7 months ago (2013-05-10 08:09:15 UTC) #6
Timothy Loh
On 2013/05/10 08:09:15, Eric Seidel wrote: > Looks very reasonable. Assuming this generates the same ...
7 years, 7 months ago (2013-05-10 08:17:19 UTC) #7
haraken
7 years, 7 months ago (2013-05-10 08:44:50 UTC) #8
Message was sent while issue was closed.
We should use this for CodeGeneratorV8.py in the future :)

Powered by Google App Engine
This is Rietveld 408576698