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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/scripts/idltopath.pm
diff --git a/Source/bindings/scripts/idltopath.pm b/Source/bindings/scripts/idltopath.pm
new file mode 100644
index 0000000000000000000000000000000000000000..c4f943dd4996f2e44f789955032580086f48acbd
--- /dev/null
+++ b/Source/bindings/scripts/idltopath.pm
@@ -0,0 +1,48 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Exporter;
+
+package idltopath;
+
+our @ISA = qw( Exporter );
+# our @EXPORT_OK = qw( export_me export_me_too );
+# These are exported by default.
+our @EXPORT = qw( idl_to_path idlToPath );
+
+my %idlToPathHash;
+sub idlToPath
+{
+ if (!%idlToPathHash) {
+ my $idlToPathFile = $ENV{"IDLTOPATHFILE"};
+ die "Missing environment variable IDLTOPATHFILE" if !$idlToPathFile;
+ print "Opening " . $idlToPathFile;
+ open(FILE, $idlToPathFile) || die;
+ while (<FILE>)
+ {
+ my ($key, $val) = split /,/;
+ # Strip CRLF from val (chomp is picky and will often remove only half).
+ $val =~ s/\s*$//;
+ $idlToPathHash{$key} .= $val;
+ }
+
+ die if !%idlToPathHash;
+ }
+
+ my $interface = shift;
+ if ($idlToPathHash{$interface}) {
+ return $idlToPathHash{$interface} . '/';
+ } elsif ($interface =~ /^SVGPath/ && $idlToPathHash{$interface . "Abs"}) {
+ return $idlToPathHash{$interface . "Abs"} . '/';
+ } else {
+ return 'fixmebratell89/';
+ }
+}
+
+
+sub idl_to_path
+{
+ my $interface = shift;
+ return idlToPath($interface)
+}
+1;

Powered by Google App Engine
This is Rietveld 408576698