xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daver...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool SchemaCompiler.java
Date Sat, 06 Mar 2004 00:23:53 GMT
daveremy    2004/03/05 16:23:53

  Modified:    v2/src/xmlcomp/org/apache/xmlbeans/impl/tool
                        SchemaCompiler.java
  Log:
  copying change from v1 SchemaCompiler rev 1.4
  
  Revision  Changes    Path
  1.7       +22 -4     xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java
  
  Index: SchemaCompiler.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SchemaCompiler.java	12 Feb 2004 20:06:25 -0000	1.6
  +++ SchemaCompiler.java	6 Mar 2004 00:23:53 -0000	1.7
  @@ -865,10 +865,12 @@
           }
   
           if (!result && !quiet)
  +        {
               System.out.println("BUILD FAILED");
  +        }
           else {
               // call schema compiler extension if registered
  -            runExtensions(extensions, system);
  +            runExtensions(extensions, system, classesDir);
           }
   
           if (cpResourceLoader != null)
  @@ -876,12 +878,24 @@
           return result;
       }
   
  -    private static void runExtensions(List extensions, SchemaTypeSystem system)
  +    private static void runExtensions(List extensions, SchemaTypeSystem system, File classesDir)
       {
           if (extensions != null && extensions.size() > 0)
           {
               SchemaCompilerExtension sce = null;
               Iterator i = extensions.iterator();
  +            Map extensionParms = null;
  +            String classesDirName = null;
  +            try
  +            {
  +                classesDirName = classesDir.getCanonicalPath();
  +            }
  +            catch(java.io.IOException e)
  +            {
  +                System.out.println("WARNING: Unable to get the path for schema jar file");
  +                classesDirName = classesDir.getAbsolutePath();
  +            }
  +
               while (i.hasNext())
               {
                   Extension extension = (Extension) i.next();
  @@ -893,20 +907,24 @@
                   {
                       System.out.println("UNABLE to instantiate schema compiler extension:"
+ extension.getClassName().getName());
                       System.out.println("EXTENSION Class was not run");
  +                    break;
                   }
                   catch (IllegalAccessException e)
                   {
                       System.out.println("ILLEGAL ACCESS Exception when attempting to instantiate
schema compiler extension: " + extension.getClassName().getName());
                       System.out.println("EXTENSION Class was not run");
  +                    break;
                   }
  -                System.out.println("Running Schema Compiler Extension: " + sce.getExtensionName());
  -                Map extensionParms = new HashMap();
  +
  +                System.out.println("Running Extension: " + sce.getExtensionName());
  +                extensionParms = new HashMap();
                   Iterator parmsi = extension.getParams().iterator();
                   while (parmsi.hasNext())
                   {
                       Extension.Param p = (Extension.Param) parmsi.next();
                       extensionParms.put(p.getName(), p.getValue());
                   }
  +                extensionParms.put("classesDir", classesDirName);
                   sce.schemaCompilerExtension(system, extensionParms);
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org


Mime
View raw message