[asterisk-scf-commits] asterisk-scf/release/ice.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Feb 7 18:46:53 CST 2011


branch "master" has been updated
       via  4dc2a1d776a6bda63a5fd2240514e1ff69ea9d45 (commit)
       via  b4758f58b4c300f038bea33a269122eaa20bec63 (commit)
       via  06439201bf6daa93eefdc891e14b7dde40b09398 (commit)
       via  2e114ac8bba2f37f537a97eb7153bde6f28036dd (commit)
      from  a9d8f48b11c4772802441aa43b8735ee18af9aa5 (commit)

Summary of changes:
 cpp/include/Slice/RubyUtil.h   |    6 ++++-
 cpp/src/Slice/RubyUtil.cpp     |   33 ++++++++++++++++++++++++++++++-
 cpp/src/slice2freeze/Main.cpp  |   38 +++++++++++++++++++++++++++++++++--
 cpp/src/slice2freezej/Main.cpp |   42 ++++++++++++++++++++++++++++++++++++---
 cpp/src/slice2php/Main.cpp     |   38 ++++++++++++++++++++++++++++++++++-
 cpp/src/slice2rb/Main.cpp      |    6 ++++-
 rb/src/IceRuby/Slice.cpp       |    5 +++-
 7 files changed, 155 insertions(+), 13 deletions(-)


- Log -----------------------------------------------------------------
commit 4dc2a1d776a6bda63a5fd2240514e1ff69ea9d45
Merge: 0643920 b4758f5
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Feb 7 19:44:54 2011 +0100

    Merge branch 'slice-plugins'
    
    Conflicts:
    	rb/src/IceRuby/Slice.cpp

diff --cc rb/src/IceRuby/Slice.cpp
index dc993d0,ca09591..a391c39
--- a/rb/src/IceRuby/Slice.cpp
+++ b/rb/src/IceRuby/Slice.cpp
@@@ -61,7 -61,7 +61,8 @@@ IceRuby_loadSlice(int argc, VALUE* argv
          opts.addOpt("", "underscore");
          opts.addOpt("", "checksum");
          opts.addOpt("", "all");
 +        opts.addOpt("", "suppress");
+         opts.addOpt("", "plugin", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
  
          vector<string> files;
          try
@@@ -117,8 -116,9 +118,10 @@@
          debug = opts.isSet("d") || opts.isSet("debug");
          all = opts.isSet("all");
          checksum = opts.isSet("checksum");
 +	suppress = opts.isSet("suppress");
  
+         vector<string> plugins = opts.argVec("plugin");
+ 
          bool ignoreRedefs = false;
  
          for(vector<string>::const_iterator p = files.begin(); p != files.end(); ++p)
@@@ -147,7 -147,7 +150,7 @@@
              ostringstream codeStream;
              IceUtilInternal::Output out(codeStream);
              out.setUseTab(false);
-             generate(u, all, checksum, includePaths, out, suppress);
 -            generate(u, all, checksum, includePaths, out, plugins);
++            generate(u, all, checksum, includePaths, out, suppress, plugins);
              u->destroy();
  
              string code = codeStream.str();

commit b4758f58b4c300f038bea33a269122eaa20bec63
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Feb 7 19:43:22 2011 +0100

    Add support for Slice translator plugins
    for Ruby dynamic code generation.

diff --git a/rb/src/IceRuby/Slice.cpp b/rb/src/IceRuby/Slice.cpp
index 4198307..ca09591 100644
--- a/rb/src/IceRuby/Slice.cpp
+++ b/rb/src/IceRuby/Slice.cpp
@@ -61,6 +61,7 @@ IceRuby_loadSlice(int argc, VALUE* argv, VALUE self)
         opts.addOpt("", "underscore");
         opts.addOpt("", "checksum");
         opts.addOpt("", "all");
+        opts.addOpt("", "plugin", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
 
         vector<string> files;
         try
@@ -116,6 +117,8 @@ IceRuby_loadSlice(int argc, VALUE* argv, VALUE self)
         all = opts.isSet("all");
         checksum = opts.isSet("checksum");
 
+        vector<string> plugins = opts.argVec("plugin");
+
         bool ignoreRedefs = false;
 
         for(vector<string>::const_iterator p = files.begin(); p != files.end(); ++p)
@@ -144,7 +147,7 @@ IceRuby_loadSlice(int argc, VALUE* argv, VALUE self)
             ostringstream codeStream;
             IceUtilInternal::Output out(codeStream);
             out.setUseTab(false);
-            generate(u, all, checksum, includePaths, out);
+            generate(u, all, checksum, includePaths, out, plugins);
             u->destroy();
 
             string code = codeStream.str();

commit 06439201bf6daa93eefdc891e14b7dde40b09398
Merge: a9d8f48 2e114ac
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Feb 7 19:36:50 2011 +0100

    Merge branch 'slice-plugins'
    
    Conflicts:
    	cpp/include/Slice/RubyUtil.h
    	cpp/src/Slice/RubyUtil.cpp
    	cpp/src/slice2rb/Main.cpp

diff --cc cpp/include/Slice/RubyUtil.h
index 574d370,8a19f4d..d67d35c
--- a/cpp/include/Slice/RubyUtil.h
+++ b/cpp/include/Slice/RubyUtil.h
@@@ -21,7 -21,10 +21,11 @@@ namespace Rub
  //
  // Generate Ruby code for a translation unit.
  //
- SLICE_API void generate(const Slice::UnitPtr&, bool, bool, const std::vector<std::string>&, IceUtilInternal::Output&, bool);
+ SLICE_API void generate(const Slice::UnitPtr&, bool, bool,
+                         const std::vector<std::string>&,
+                         IceUtilInternal::Output&,
++                        bool,
+                         const std::vector<std::string>&);
  
  //
  // Check the given identifier against Ruby's list of reserved words. If it matches
diff --cc cpp/src/Slice/RubyUtil.cpp
index 1dbd43d,8f30da0..bc3dba0
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@@ -1657,15 -1631,38 +1659,44 @@@ Slice::Ruby::CodeVisitor::collectExcept
  }
  
  void
- Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out, bool suppress)
+ Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum,
+                       const vector<string>& includePaths,
+                       Output& out,
++                      bool suppress,
+                       const vector<string>& plugins)
  {
+     for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
+     {
+         IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
+         IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
+         if(sym == 0)
+         {
+             string msg = library->getErrorMessage();
+             cerr << "Unable to find " << *plugin << " = " << msg << endl;
+         }
+         
+         Plugin::VisitorList* pluginVisitors;
+         Plugin::FACTORY factory = (Plugin::FACTORY) sym;
+         pluginVisitors = factory(Plugin::LanguagePython);
+         
+         if(pluginVisitors)
+         {
+             for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
+             {
+                 un->visit(*it, true);
+                 delete *it;
+             }
+             delete pluginVisitors;
+         }
+     }
+ 
      out << nl << "require 'Ice'";
  
 +    if(suppress)
 +    {
 +	un->setScopeGeneratorPolicy(createSuppressorGenerator());
 +    }
 +
      if(!all)
      {
          vector<string> paths = includePaths;
diff --cc cpp/src/slice2rb/Main.cpp
index 550eb68,e8e55fe..a02649d
--- a/cpp/src/slice2rb/Main.cpp
+++ b/cpp/src/slice2rb/Main.cpp
@@@ -90,7 -90,7 +90,8 @@@ usage(const char* n
          "--underscore         Permit underscores in Slice identifiers.\n"
          "--all                Generate code for Slice definitions in included files.\n"
          "--checksum           Generate checksums for Slice definitions.\n"
 +	"--suppress           Suppress tagged modules from being written.\n"
+         "--plugin PATH        Load and apply plugin before generating output.\n"
          ;
  }
  
@@@ -111,7 -111,7 +112,8 @@@ compile(int argc, char* argv[]
      opts.addOpt("", "underscore");
      opts.addOpt("", "all");
      opts.addOpt("", "checksum");
 +    opts.addOpt("", "suppress");
+     opts.addOpt("", "plugin", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
       
      vector<string> args;
      try
@@@ -300,7 -300,7 +304,7 @@@
                          //
                          // Generate the Ruby mapping.
                          //
-                         generate(u, all, checksum, includePaths, out, suppress);
 -                        generate(u, all, checksum, includePaths, out, plugins);
++                        generate(u, all, checksum, includePaths, out, suppress, plugins);
  
                          out.close();
                      }

commit 2e114ac8bba2f37f537a97eb7153bde6f28036dd
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Mon Feb 7 19:30:54 2011 +0100

    Add support for loading and applying Slice translator
    plugins for Ruby, PHP, Freeze and FreezeJ.

diff --git a/cpp/include/Slice/RubyUtil.h b/cpp/include/Slice/RubyUtil.h
index fe9934a..8a19f4d 100644
--- a/cpp/include/Slice/RubyUtil.h
+++ b/cpp/include/Slice/RubyUtil.h
@@ -21,7 +21,10 @@ namespace Ruby
 //
 // Generate Ruby code for a translation unit.
 //
-SLICE_API void generate(const Slice::UnitPtr&, bool, bool, const std::vector<std::string>&, IceUtilInternal::Output&);
+SLICE_API void generate(const Slice::UnitPtr&, bool, bool,
+                        const std::vector<std::string>&,
+                        IceUtilInternal::Output&,
+                        const std::vector<std::string>&);
 
 //
 // Check the given identifier against Ruby's list of reserved words. If it matches
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index f62dbc1..8f30da0 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -10,8 +10,10 @@
 #include <Slice/RubyUtil.h>
 #include <Slice/Checksum.h>
 #include <Slice/Util.h>
+#include <Slice/Plugin.h>
 #include <IceUtil/Functional.h>
 #include <IceUtil/InputUtil.h>
+#include <IceUtil/DynamicLibrary.h>
 #include <iterator>
 
 using namespace std;
@@ -1629,8 +1631,36 @@ Slice::Ruby::CodeVisitor::collectExceptionMembers(const ExceptionPtr& p, MemberI
 }
 
 void
-Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out)
+Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum,
+                      const vector<string>& includePaths,
+                      Output& out,
+                      const vector<string>& plugins)
 {
+    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
+    {
+        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
+        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
+        if(sym == 0)
+        {
+            string msg = library->getErrorMessage();
+            cerr << "Unable to find " << *plugin << " = " << msg << endl;
+        }
+        
+        Plugin::VisitorList* pluginVisitors;
+        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
+        pluginVisitors = factory(Plugin::LanguagePython);
+        
+        if(pluginVisitors)
+        {
+            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
+            {
+                un->visit(*it, true);
+                delete *it;
+            }
+            delete pluginVisitors;
+        }
+    }
+
     out << nl << "require 'Ice'";
 
     if(!all)
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index 764baa0..8510309 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -12,10 +12,12 @@
 #include <IceUtil/CtrlCHandler.h>
 #include <IceUtil/Mutex.h>
 #include <IceUtil/MutexPtrLock.h>
+#include <IceUtil/DynamicLibrary.h>
 #include <Slice/Preprocessor.h>
 #include <Slice/CPlusPlusUtil.h>
 #include <Slice/FileTracker.h>
 #include <Slice/Util.h>
+#include <Slice/Plugin.h>
 #include <IceUtil/OutputUtil.h>
 #include <IceUtil/StringUtil.h>
 #include <cstring>
@@ -241,6 +243,7 @@ usage(const char* n)
         "-d, --debug           Print debug messages.\n"
         "--ice                 Permit `Ice' prefix (for building Ice source code only).\n"
         "--underscore          Permit underscores in Slice identifiers.\n"
+        "--plugin PATH         Load and apply plugin before generating output.\n"
         ;
 }
 
@@ -1370,7 +1373,8 @@ void
 gen(const string& name, const UnitPtr& u, const vector<string>& includePaths, const vector<string>& extraHeaders,
     const vector<Dict>& dicts, const vector<Index>& indices, const string& include, const string& headerExtension,
     const string& sourceExtension, string dllExport, const StringList& includes, const vector<string>& args,
-    const string& output)
+    const string& output,
+    const vector<string>& plugins)
 {
     string fileH = args[0];
     fileH += "." + headerExtension;
@@ -1384,6 +1388,31 @@ gen(const string& name, const UnitPtr& u, const vector<string>& includePaths, co
         fileC = output + '/' + fileC;
     }
 
+    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
+    {
+        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
+        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
+        if(sym == 0)
+        {
+            string msg = library->getErrorMessage();
+            cerr << "Unable to find " << *plugin << " = " << msg << endl;
+        }
+        
+        Plugin::VisitorList* pluginVisitors;
+        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
+        pluginVisitors = factory(Plugin::LanguagePython);
+        
+        if(pluginVisitors)
+        {
+            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
+            {
+                u->visit(*it, true);
+                delete *it;
+            }
+            delete pluginVisitors;
+        }
+    }
+
     u->mergeModules();
     u->sort();
 
@@ -1528,6 +1557,7 @@ compile(int argc, char* argv[])
     opts.addOpt("d", "debug");
     opts.addOpt("", "ice");
     opts.addOpt("", "underscore");
+    opts.addOpt("", "plugin", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
      
     vector<string> args;
     try
@@ -1585,7 +1615,9 @@ compile(int argc, char* argv[])
         }
     }
 
-    bool preprocess= opts.isSet("E");
+    vector<string> plugins = opts.argVec("plugin");
+
+    bool preprocess = opts.isSet("E");
 
     string include = opts.optArg("include-dir");
 
@@ -2010,7 +2042,7 @@ compile(int argc, char* argv[])
         try
         {
             gen(argv[0], u, includePaths, extraHeaders, dicts, indices, include, headerExtension,
-                sourceExtension, dllExport, includes, args, output);
+                sourceExtension, dllExport, includes, args, output, plugins);
         }
         catch(const string& ex)
         {
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp
index c4badf1..7de7dcd 100644
--- a/cpp/src/slice2freezej/Main.cpp
+++ b/cpp/src/slice2freezej/Main.cpp
@@ -12,10 +12,12 @@
 #include <IceUtil/CtrlCHandler.h>
 #include <IceUtil/Mutex.h>
 #include <IceUtil/MutexPtrLock.h>
+#include <IceUtil/DynamicLibrary.h>
 #include <Slice/Preprocessor.h>
 #include <Slice/FileTracker.h>
 #include <Slice/JavaUtil.h>
 #include <Slice/Util.h>
+#include <Slice/Plugin.h>
 #include <iterator>
 
 using namespace std;
@@ -93,7 +95,7 @@ struct Index
 class FreezeGenerator : public JavaGenerator
 {
 public:
-    FreezeGenerator(const string&, const string&);
+    FreezeGenerator(const string&, const string&, const vector<string>&);
     virtual ~FreezeGenerator();
 
     void generate(UnitPtr&, const Dict&);
@@ -106,11 +108,14 @@ private:
     string objectToVar(const TypePtr&, const string&);
 
     const string _prog;
+    const vector<string> _plugins;
 };
 
-FreezeGenerator::FreezeGenerator(const string& prog, const string& dir)
+FreezeGenerator::FreezeGenerator(const string& prog, const string& dir,
+                                 const vector<string>& plugins)
     : JavaGenerator(dir),
-      _prog(prog)
+      _prog(prog),
+      _plugins(plugins)
 {
 }
 
@@ -260,6 +265,31 @@ FreezeGenerator::objectToVar(const TypePtr& type, const string& param)
 void
 FreezeGenerator::generate(UnitPtr& u, const Dict& dict)
 {
+    for(vector<string>::const_iterator plugin = _plugins.begin(); plugin != _plugins.end(); plugin++)
+    {
+        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
+        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
+        if(sym == 0)
+        {
+            string msg = library->getErrorMessage();
+            cerr << "Unable to find " << *plugin << " = " << msg << endl;
+        }
+        
+        Plugin::VisitorList* pluginVisitors;
+        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
+        pluginVisitors = factory(Plugin::LanguagePython);
+        
+        if(pluginVisitors)
+        {
+            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
+            {
+                u->visit(*it, true);
+                delete *it;
+            }
+            delete pluginVisitors;
+        }
+    }
+
     //
     // The dictionary name may include a package.
     //
@@ -1460,6 +1490,7 @@ usage(const char* n)
         "--ice                     Permit `Ice' prefix (for building Ice source code only).\n"
         "--underscore              Permit underscores in Slice identifiers.\n"
         "--meta META               Define global metadata directive META.\n"
+        "--plugin PATH             Load and apply plugin before generating output.\n"
         ;
 }
 
@@ -1483,6 +1514,7 @@ compile(int argc, char* argv[])
     opts.addOpt("", "ice");
     opts.addOpt("", "underscore");
     opts.addOpt("", "meta", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
+    opts.addOpt("", "plugin", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
 
     vector<string> args;
     try
@@ -1528,6 +1560,8 @@ compile(int argc, char* argv[])
         cppArgs.push_back("-I" + Preprocessor::normalizeIncludePath(*i));
     }
 
+    vector<string> plugins = opts.argVec("plugin");
+
     bool preprocess = opts.isSet("E");
 
     string include = opts.optArg("include-dir");
@@ -1848,7 +1882,7 @@ compile(int argc, char* argv[])
         u->mergeModules();
         u->sort();
 
-        FreezeGenerator gen(argv[0], output);
+        FreezeGenerator gen(argv[0], output, plugins);
 
         JavaGenerator::validateMetaData(u);
 
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index 4e05aff..1cb4770 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -16,11 +16,13 @@
 #include <IceUtil/StringUtil.h>
 #include <IceUtil/Mutex.h>
 #include <IceUtil/MutexPtrLock.h>
+#include <IceUtil/DynamicLibrary.h>
 #include <Slice/Checksum.h>
 #include <Slice/Preprocessor.h>
 #include <Slice/FileTracker.h>
 #include <Slice/PHPUtil.h>
 #include <Slice/Util.h>
+#include <Slice/Plugin.h>
 #include <cstring>
 #include <climits>
 
@@ -1391,8 +1393,36 @@ CodeVisitor::collectExceptionMembers(const ExceptionPtr& p, MemberInfoList& allM
 }
 
 static void
-generate(const UnitPtr& un, bool all, bool checksum, bool ns, const vector<string>& includePaths, Output& out)
+generate(const UnitPtr& un, bool all, bool checksum, bool ns,
+         const vector<string>& includePaths,
+         Output& out,
+         const vector<string>& plugins)
 {
+    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
+    {
+        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
+        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
+        if(sym == 0)
+        {
+            string msg = library->getErrorMessage();
+            cerr << "Unable to find " << *plugin << " = " << msg << endl;
+        }
+        
+        Plugin::VisitorList* pluginVisitors;
+        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
+        pluginVisitors = factory(Plugin::LanguagePython);
+        
+        if(pluginVisitors)
+        {
+            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
+            {
+                un->visit(*it, true);
+                delete *it;
+            }
+            delete pluginVisitors;
+        }
+    }
+
     if(!all)
     {
         vector<string> paths = includePaths;
@@ -1531,6 +1561,7 @@ usage(const char* n)
         "--all                Generate code for Slice definitions in included files.\n"
         "--checksum           Generate checksums for Slice definitions.\n"
         "-n, --namespace      Use PHP namespaces (requires PHP 5.3.0 or later).\n"
+        "--plugin PATH        Load and apply plugin before generating output.\n"
         ;
 }
 
@@ -1552,6 +1583,7 @@ compile(int argc, char* argv[])
     opts.addOpt("", "all");
     opts.addOpt("", "checksum");
     opts.addOpt("n", "namespace");
+    opts.addOpt("", "plugin", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
      
     vector<string> args;
     try
@@ -1597,6 +1629,8 @@ compile(int argc, char* argv[])
         cppArgs.push_back("-I" + Preprocessor::normalizeIncludePath(*i));
     }
 
+    vector<string> plugins = opts.argVec("plugin");
+
     bool preprocess = opts.isSet("E");
 
     string output = opts.optArg("output-dir");
@@ -1741,7 +1775,7 @@ compile(int argc, char* argv[])
                         //
                         // Generate the PHP mapping.
                         //
-                        generate(u, all, checksum, ns, includePaths, out);
+                        generate(u, all, checksum, ns, includePaths, out, plugins);
 
                         out << "?>\n";
                         out.close();
diff --git a/cpp/src/slice2rb/Main.cpp b/cpp/src/slice2rb/Main.cpp
index e4b6cd0..e8e55fe 100644
--- a/cpp/src/slice2rb/Main.cpp
+++ b/cpp/src/slice2rb/Main.cpp
@@ -90,6 +90,7 @@ usage(const char* n)
         "--underscore         Permit underscores in Slice identifiers.\n"
         "--all                Generate code for Slice definitions in included files.\n"
         "--checksum           Generate checksums for Slice definitions.\n"
+        "--plugin PATH        Load and apply plugin before generating output.\n"
         ;
 }
 
@@ -110,6 +111,7 @@ compile(int argc, char* argv[])
     opts.addOpt("", "underscore");
     opts.addOpt("", "all");
     opts.addOpt("", "checksum");
+    opts.addOpt("", "plugin", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
      
     vector<string> args;
     try
@@ -155,6 +157,8 @@ compile(int argc, char* argv[])
         cppArgs.push_back("-I" + Preprocessor::normalizeIncludePath(*i));
     }
 
+    vector<string> plugins = opts.argVec("plugin");
+
     bool preprocess = opts.isSet("E");
 
     string output = opts.optArg("output-dir");
@@ -296,7 +300,7 @@ compile(int argc, char* argv[])
                         //
                         // Generate the Ruby mapping.
                         //
-                        generate(u, all, checksum, includePaths, out);
+                        generate(u, all, checksum, includePaths, out, plugins);
 
                         out.close();
                     }

-----------------------------------------------------------------------


-- 
asterisk-scf/release/ice.git



More information about the asterisk-scf-commits mailing list