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

Side by Side Diff: Source/bindings/scripts/generate_bindings.pl

Issue 29323008: Fix IDL dependency computation for partial interfaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload 4 Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -w
2 # 2 #
3 # Copyright (C) 2005 Apple Computer, Inc. 3 # Copyright (C) 2005 Apple Computer, Inc.
4 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 4 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
5 # 5 #
6 # This file is part of WebKit 6 # This file is part of WebKit
7 # 7 #
8 # This library is free software; you can redistribute it and/or 8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Library General Public 9 # modify it under the terms of the GNU Library General Public
10 # License as published by the Free Software Foundation; either 10 # License as published by the Free Software Foundation; either
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 my ($idlFile, @followingIdlFiles) = split(/\s+/, $line); 81 my ($idlFile, @followingIdlFiles) = split(/\s+/, $line);
82 if ($idlFile and basename($idlFile) eq basename($targetIdlFile)) { 82 if ($idlFile and basename($idlFile) eq basename($targetIdlFile)) {
83 $idlFound = 1; 83 $idlFound = 1;
84 # We sort the dependency IDL files so that the corresponding code is generated 84 # We sort the dependency IDL files so that the corresponding code is generated
85 # in a consistent order. This is important for the bindings tests. 85 # in a consistent order. This is important for the bindings tests.
86 @dependencyIdlFiles = sort @followingIdlFiles; 86 @dependencyIdlFiles = sort @followingIdlFiles;
87 } 87 }
88 } 88 }
89 close FH; 89 close FH;
90 90
91 # $additionalIdlFiles is list of IDL files which should not be included in 91 # $additionalIdlFiles is for IDL files not listed in the interface
92 # DerivedSources*.cpp (i.e. they are not described in the interface 92 # dependencies file, namely generated IDL files for interfaces
93 # dependencies file) but should generate .h and .cpp files. 93 # (not partial interfaces), so we need to generate .h and .cpp files.
94 if (!$idlFound and $additionalIdlFiles) { 94 if (!$idlFound and $additionalIdlFiles) {
95 my @idlFiles = shellwords($additionalIdlFiles); 95 my @idlFiles = shellwords($additionalIdlFiles);
96 $idlFound = grep { $_ and basename($_) eq basename($targetIdlFile) } @id lFiles; 96 $idlFound = grep { $_ and basename($_) eq basename($targetIdlFile) } @id lFiles;
97 } 97 }
98 98
99 if (!$idlFound) { 99 if (!$idlFound) {
100 # We generate empty .h and .cpp files just to tell build scripts that .h and .cpp files are created. 100 # IDL files for dependencies (partial interfaces and interfaces
101 # implemented elsewhere). We generate empty .h and .cpp files just to
102 # tell build scripts that outputs have been created.
101 generateEmptyHeaderAndCpp($targetInterfaceName, $outputDirectory); 103 generateEmptyHeaderAndCpp($targetInterfaceName, $outputDirectory);
102 exit 0; 104 exit 0;
103 } 105 }
104 } 106 }
105 107
106 # Parse the target IDL file. 108 # Parse the target IDL file.
107 my $targetParser = idl_parser->new(!$verbose); 109 my $targetParser = idl_parser->new(!$verbose);
108 my $targetDocument = $targetParser->Parse($targetIdlFile, $preprocessor); 110 my $targetDocument = $targetParser->Parse($targetIdlFile, $preprocessor);
109 111
110 if ($idlAttributesFile) { 112 if ($idlAttributesFile) {
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 last OUTER; 297 last OUTER;
296 } 298 }
297 } 299 }
298 } 300 }
299 if ($error) { 301 if ($error) {
300 die "IDL ATTRIBUTE CHECKER ERROR: $error 302 die "IDL ATTRIBUTE CHECKER ERROR: $error
301 If you want to add a new IDL attribute, you need to add it to bindings/scripts/I DLAttributes.txt and add explanations to the Blink IDL document (http://chromium .org/blink/webidl). 303 If you want to add a new IDL attribute, you need to add it to bindings/scripts/I DLAttributes.txt and add explanations to the Blink IDL document (http://chromium .org/blink/webidl).
302 "; 304 ";
303 } 305 }
304 } 306 }
OLDNEW
« no previous file with comments | « Source/bindings/derived_sources.gyp ('k') | Source/build/scripts/list_idl_files_with_partial_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698