Author: andreia
Date: 2008-01-02 09:32:28 -0500 (Wed, 02 Jan 2008)
New Revision: 92103

Modified:
   trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/ChangeLog
   trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/xpidl2cs.pl
Log:
* xpidl2cs.pl: Add support for getting idls from other paths, fix
script name bug.

2008-01-02  Andreia Gaita <[EMAIL PROTECTED]>

Modified: trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/ChangeLog       2008-01-02 
14:19:16 UTC (rev 92102)
+++ trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/ChangeLog       2008-01-02 
14:32:28 UTC (rev 92103)
@@ -1,3 +1,8 @@
+2008-01-02  Andreia Gaita  <[EMAIL PROTECTED]>
+
+       * xpidl2cs.pl: Add support for getting idls from other paths, fix
+       script name bug.
+
 2007-12-28  Andreia Gaita  <[EMAIL PROTECTED]>
 
        * xpidl2cs.pl: Generates c# interfaces from xpcom (mozilla) 

Modified: trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/xpidl2cs.pl
===================================================================
--- trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/xpidl2cs.pl     2008-01-02 
14:19:16 UTC (rev 92102)
+++ trunk/mcs/class/Mono.Mozilla/tools/xpidl2cs/xpidl2cs.pl     2008-01-02 
14:32:28 UTC (rev 92103)
@@ -21,8 +21,14 @@
 # Boston, MA 02111-1307, USA.
 ##############################################################
 
-open FILE, '<', @ARGV or die "Can't open file @ARGV";
+die "Usage: xpidl2cs.pl file.idl [/path/to/idl/]" if length @ARGV == 0;
 
+my $file = shift;
+my $path = shift if length @ARGV > 0;
+
+
+open FILE, '<', $path.$file or die "Can't open file $path$file";
+
 my %interface = (
                 properties => (), 
                 items => "", 
@@ -61,8 +67,7 @@
 sub parse_parent {
     my $x = shift;
 
- #   print "perl xpidlimport.pl $x.idl\n";
-    `perl xpidlimport.pl $x.idl`;
+    `perl xpidl2cs.pl $x.idl $path`;
 
     open my $f, '<', "$x.cs";
     my $start = 0;
@@ -314,7 +319,7 @@
     my $name = $interface->{"class"};
     print "$name.cs\n";
     open X, ">$name.cs";
-    print X "// THIS FILE AUTOMATICALLY GENERATED BY xpidlimport.pl\n";
+    print X "// THIS FILE AUTOMATICALLY GENERATED BY xpidl2cs.pl\n";
     print X "// EDITING IS PROBABLY UNWISE\n";
     print X "// Permission is hereby granted, free of charge, to any person 
obtaining\n";
     print X "// a copy of this software and associated documentation files 
(the\n";
@@ -404,9 +409,9 @@
 
 sub generate_dependents {
     for my $file (keys %dependents) {
-       print "generating $file\n";
-       if (! (-e "$file.cs") && -e "$file.idl") {
-           my $ret = `perl xpidlimport.pl $file.idl`;
+       print "generating $path$file.idl\n";
+       if (! (-e "$file.cs") && -e "$path$file.idl") {
+           my $ret = `perl xpidl2cs.pl $file.idl $path`;
            print "\n$ret";
        }
     }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to