You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by da...@apache.org on 2004/01/10 03:29:04 UTC

cvs commit: xml-xmlbeans/v1/src/xmlcomp/org/apache/xmlbeans/impl/tool SchemaCompiler.java

daveremy    2004/01/09 18:29:04

  Modified:    v1/src/xmlcomp/org/apache/xmlbeans/impl/tool
                        SchemaCompiler.java
  Log:
  commit on behalf of Kevin Krouse.
  
  provide a classesDir parameter to SchemaCompiler extensions
  
  Revision  Changes    Path
  1.4       +22 -4     xml-xmlbeans/v1/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java
  
  Index: SchemaCompiler.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v1/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SchemaCompiler.java	24 Sep 2003 23:31:11 -0000	1.3
  +++ SchemaCompiler.java	10 Jan 2004 02:29:04 -0000	1.4
  @@ -871,10 +871,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)
  @@ -882,12 +884,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();
  @@ -899,20 +913,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