{
start = System.currentTimeMillis();
// filer implementation writes binary .xsd and generated source to disk
Repackager repackager = (repackage == null ? null : new Repackager(repackage));
FilerImpl filer = new FilerImpl(classesDir, srcDir, repackager, verbose, incrSrcGen);
// currently just for schemaCodePrinter
XmlOptions options = new XmlOptions();
if (codePrinter != null)
options.setSchemaCodePrinter(codePrinter);
if (javasource != null)
options.setGenerateJavaVersion(javasource);
// save .xsb files
system.save(filer);
// gen source files
result &= SchemaTypeSystemCompiler.generateTypes(system, filer, options);
if (result)
{
finish = System.currentTimeMillis();
if (!quiet)
System.out.println("Time to generate code: " + ((double)(finish - start) / 1000.0) + " seconds" );
}
// compile source
if (result && !nojavac)
{
start = System.currentTimeMillis();
List sourcefiles = filer.getSourceFiles();
if (javaFiles != null)
sourcefiles.addAll(java.util.Arrays.asList(javaFiles));
if (!CodeGenUtil.externalCompile(sourcefiles, classesDir, classpath, debug, compiler, javasource, memoryInitialSize, memoryMaximumSize, quiet, verbose))
result = false;