Changeset 155850 in webkit


Ignore:
Timestamp:
Sep 16, 2013 5:28:59 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Check DOM bindings API compatibility while building
https://bugs.webkit.org/show_bug.cgi?id=101224

Reviewed by Gustavo Noronha Silva.

A .symbols file is now generated for every DOM binding public API
object. It contains the signature of all public methods. We keep a
single file with the signature of all public methods in the source
tree. When DOM bindings are generated, a new symbols file is
created concatenating all .symbols files generated and it's
compared with the symbols file in the source tree using a script
that checks if the changes are API compatible or not. In case of
API break the build finishes showing the differences found in the
symbol files. If API compatible changes are found, the diff is
shown in stdout, suggesting to run the gobject-run-api-break-test
with the --reset-results option to update the symbols file, and
the build continues. If there aren't API changes the build
continues silently.

  • GNUmakefile.am:
  • bindings/gobject/GNUmakefile.am:
  • bindings/gobject/WebKitDOMCustom.symbols: Added.
  • bindings/gobject/WebKitDOMEventTarget.symbols: Added.
  • bindings/gobject/WebKitDOMObject.symbols: Added.
  • bindings/gobject/webkitdom.symbols: Added.
  • bindings/scripts/CodeGeneratorGObject.pm:

(GenerateFunction):
(WriteData):

  • bindings/scripts/gobject-run-api-break-test: Added.

(check_api):

Location:
trunk/Source/WebCore
Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r155849 r155850  
     12013-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Check DOM bindings API compatibility while building
     4        https://bugs.webkit.org/show_bug.cgi?id=101224
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        A .symbols file is now generated for every DOM binding public API
     9        object. It contains the signature of all public methods. We keep a
     10        single file with the signature of all public methods in the source
     11        tree. When DOM bindings are generated, a new symbols file is
     12        created concatenating all .symbols files generated and it's
     13        compared with the symbols file in the source tree using a script
     14        that checks if the changes are API compatible or not. In case of
     15        API break the build finishes showing the differences found in the
     16        symbol files. If API compatible changes are found, the diff is
     17        shown in stdout, suggesting to run the gobject-run-api-break-test
     18        with the --reset-results option to update the symbols file, and
     19        the build continues. If there aren't API changes the build
     20        continues silently.
     21
     22        * GNUmakefile.am:
     23        * bindings/gobject/GNUmakefile.am:
     24        * bindings/gobject/WebKitDOMCustom.symbols: Added.
     25        * bindings/gobject/WebKitDOMEventTarget.symbols: Added.
     26        * bindings/gobject/WebKitDOMObject.symbols: Added.
     27        * bindings/gobject/webkitdom.symbols: Added.
     28        * bindings/scripts/CodeGeneratorGObject.pm:
     29        (GenerateFunction):
     30        (WriteData):
     31        * bindings/scripts/gobject-run-api-break-test: Added.
     32        (check_api):
     33
    1342013-09-16  Andreas Kling  <akling@apple.com>
    235
  • trunk/Source/WebCore/GNUmakefile.am

    r155832 r155850  
    647647        Source/WebCore/bindings/scripts/generate-bindings.pl \
    648648        Source/WebCore/bindings/scripts/gobject-generate-headers.pl \
     649        Source/WebCore/bindings/scripts/gobject-run-api-break-test \
    649650        Source/WebCore/bindings/scripts/preprocessor.pm \
    650651        Source/WebCore/bindings/scripts/preprocess-idls.pl \
  • trunk/Source/WebCore/bindings/gobject/GNUmakefile.am

    r154830 r155850  
    472472        $(AM_V_GEN)echo $(gdom_class_list) | $(PERL) $< defines > $@
    473473
     474noinst_DATA += DerivedSources/webkitdom/webkitdom.symbols
     475gdom_symbol_files := $(patsubst %.h,%.symbols, $(filter DerivedSources/webkitdom/WebKitDOM%.h, $(webkitgtk_gdom_built_h_api)))
     476
     477$(top_builddir)/DerivedSources/webkitdom/WebKitDOMObject.symbols: $(WebCore)/bindings/gobject/WebKitDOMObject.symbols
     478        $(AM_V_GEN)cp -f $< $@
     479
     480$(top_builddir)/DerivedSources/webkitdom/WebKitDOMEventTarget.symbols: $(WebCore)/bindings/gobject/WebKitDOMEventTarget.symbols
     481        $(AM_V_GEN)cp -f $< $@
     482
     483$(top_builddir)/DerivedSources/webkitdom/WebKitDOMCustom.symbols: $(WebCore)/bindings/gobject/WebKitDOMCustom.symbols
     484        $(AM_V_GEN)cp -f $< $@
     485
     486DerivedSources/webkitdom/webkitdom.symbols: $(gdom_symbol_files) $(WebCore)/bindings/gobject/webkitdom.symbols $(WebCore)/bindings/scripts/gobject-run-api-break-test
     487        $(AM_V_GEN)cat $(gdom_symbol_files) > gdom-gen-symbols \
     488        && $(PYTHON) $(WebCore)/bindings/scripts/gobject-run-api-break-test $(WebCore)/bindings/gobject/webkitdom.symbols gdom-gen-symbols \
     489        && (cmp -s gdom-gen-symbols $@ || cp gdom-gen-symbols $@) \
     490        && rm -f gdom-gen-symbols
     491
     492EXTRA_DIST += \
     493        $(WebCore)/bindings/gobject/WebKitDOMCustom.symbols \
     494        $(WebCore)/bindings/gobject/WebKitDOMEventTarget.symbols \
     495        $(WebCore)/bindings/gobject/WebKitDOMObject.symbols \
     496        $(WebCore)/bindings/gobject/webkitdom.symbols
     497
     498CLEAN_FILES = \
     499        $(gdom_symbol_files)
     500
    474501# Because WebCore/bindings/gobject/WebKitDOMObject.h is static source but is also a distributed header
    475502# required by other distributed headers (both static and auto-generated), need to move this to the
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r155784 r155850  
    896896
    897897    my $functionSig = "${className}* self";
     898    my $symbolSig = "${className}*";
    898899
    899900    my @callImplParams;
     
    911912
    912913        $functionSig .= ", ${const}$paramType $paramName";
     914        $symbolSig .= ", ${const}$paramType";
    913915
    914916        my $paramIsGDOMType = IsGDOMClassType($paramIDLType);
     
    929931
    930932    $functionSig .= ", GError** error" if $raisesException;
     933    $symbolSig .= ", GError**" if $raisesException;
     934
     935    push(@symbols, "$returnType $functionName($symbolSig)\n");
    931936
    932937    # Insert introspection annotations
     
    15421547    close(IMPL);
    15431548
     1549    # Write a symbols file.
     1550    my $symbolsFileName = "$outputDir/" . $basename . ".symbols";
     1551    open(SYM, ">$symbolsFileName") or die "Couldn't open file $symbolsFileName";
     1552    print SYM @symbols;
     1553    close(SYM);
     1554
    15441555    %implIncludes = ();
    15451556    %hdrIncludes = ();
     
    15521563    @cBodyProperties = ();
    15531564    @cStructPriv = ();
     1565
     1566    @symbols = ();
    15541567}
    15551568
Note: See TracChangeset for help on using the changeset viewer.