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

Side by Side Diff: Source/bindings/scripts/idltopath.pm

Issue 14456006: Fixes to make scripts generate includes with paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated Created 7 years, 8 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
OLDNEW
(Empty)
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use Exporter;
5
6 package idltopath;
7
8 our @ISA = qw( Exporter );
9 # our @EXPORT_OK = qw( export_me export_me_too );
10 # These are exported by default.
11 our @EXPORT = qw( idl_to_path idlToPath );
12
13 my %idlToPathHash;
14 sub idlToPath
15 {
16 if (!%idlToPathHash) {
17 my $idlToPathFile = $ENV{"IDLTOPATHFILE"};
18 die "Missing environment variable IDLTOPATHFILE" if !$idlToPathFile;
19 print "Opening " . $idlToPathFile;
20 open(FILE, $idlToPathFile) || die;
21 while (<FILE>)
22 {
23 my ($key, $val) = split /,/;
24 # Strip CRLF from val (chomp is picky and will often remove only hal f).
25 $val =~ s/\s*$//;
26 $idlToPathHash{$key} .= $val;
27 }
28
29 die if !%idlToPathHash;
30 }
31
32 my $interface = shift;
33 if ($idlToPathHash{$interface}) {
34 return $idlToPathHash{$interface} . '/';
35 } elsif ($interface =~ /^SVGPath/ && $idlToPathHash{$interface . "Abs"}) {
36 return $idlToPathHash{$interface . "Abs"} . '/';
37 } else {
38 return 'fixmebratell89/';
39 }
40 }
41
42
43 sub idl_to_path
44 {
45 my $interface = shift;
46 return idlToPath($interface)
47 }
48 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698