Skip to content

Instantly share code, notes, and snippets.

@markandrus
Last active December 28, 2015 02:09
Show Gist options
  • Save markandrus/c66c577f067e91dd102d to your computer and use it in GitHub Desktop.
Save markandrus/c66c577f067e91dd102d to your computer and use it in GitHub Desktop.
Generate Blink/v8 bindings with idl_compiler.py
#!/bin/sh
# It's not so clear how to use idl_compiler.py, and the .gyp/.gn files are fairly
# opaque (not to mention the "Global Information" section of
# https://www.chromium.org/developers/design-documents/idl-compiler#TOC-Global-information
# isn't even filled out... oh well).
set -e
echo "Generating core-files-list.txt..."
find core -name \*.idl ! -name InspectorInstrumentation.idl >core-files-list.txt
echo "Computing InterfacesInfoCore.pickle and ComponentInfoCore.pickle..."
./bindings/scripts/compute_interfaces_info_individual.py \
--idl-files-list=core-files-list.txt \
--interfaces-info-file=core/InterfacesInfoCore.pickle \
--component-info-file=core/ComponentInfoCore.pickle \
--write-file-only-if-changed=0
echo "Generating modules-files-list.txt..."
find modules -name \*.idl >modules-files-list.txt
echo "Computing InterfacesInfoModules.pickle and ComponentInfoModules.pickle..."
./bindings/scripts/compute_interfaces_info_individual.py \
--idl-files-list=modules-files-list.txt \
--interfaces-info-file=modules/InterfacesInfoModules.pickle \
--component-info-file=modules/ComponentInfoModules.pickle \
--write-file-only-if-changed=0
echo "Computing InterfacesInfoOverall.pickle..."
./bindings/scripts/compute_interfaces_info_overall.py \
--write-file-only-if-changed=0 \
core/InterfacesInfoCore.pickle \
modules/InterfacesInfoModules.pickle \
modules/InterfacesInfoOverall.pickle
echo "Generating..."
rm -rf /tmp/idl
mkdir -p /tmp/idl/out
mkdir -p /tmp/idl/impl
./bindings/scripts/idl_compiler.py \
--output-directory=/tmp/idl/out \
--impl-output-directory=/tmp/idl/impl \
--info-dir=. \
--write-file-only-if-changed=0 \
--target-component=modules \
modules/mediastream/RTCSessionDescription.idl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment