// do all the work to get the catalog
DatabaseType database = getProjectDatabase(projectReader);
if (database == null) {
return null;
}
final Catalog catalog = compileCatalogInternal(database, ddlReaderList, jarOutput);
if (catalog == null) {
return null;
}
// Build DDL from Catalog Data
m_canonicalDDL = CatalogSchemaTools.toSchema(catalog, m_importLines);
// generate the catalog report and write it to disk
try {
m_report = ReportMaker.report(m_catalog, m_warnings, m_canonicalDDL);
File file = new File("catalog-report.html");
FileWriter fw = new FileWriter(file);
fw.write(m_report);
fw.close();
m_reportPath = file.getAbsolutePath();
} catch (IOException e) {
e.printStackTrace();
return null;
}
jarOutput.put(AUTOGEN_DDL_FILE_NAME, m_canonicalDDL.getBytes(Constants.UTF8ENCODING));
if (DEBUG_VERIFY_CATALOG) {
debugVerifyCatalog(jarOutput, catalog);
}
// WRITE CATALOG TO JAR HERE
final String catalogCommands = catalog.serialize();
byte[] catalogBytes = catalogCommands.getBytes(Constants.UTF8ENCODING);
try {
// Don't update buildinfo if it's already present, e.g. while upgrading.