* @param args
*/
public static void main(String[] args) throws Exception {
Transformations transform = new CougarTransformations();
IDLReader reader = new IDLReader();
Log log = new SystemStreamLog();
File idd = new File("src\\main\\resources\\BaselineService.xml");
InterceptingResolver resolver = new InterceptingResolver();
Document iddDoc = XmlUtil.parse(idd, resolver);
File ext = new File("src\\main\\resources\\BaselineService-Extensions.xml");
Document extDoc = null;
if (ext.exists()) {
extDoc = XmlUtil.parse(ext, resolver);
}
reader.init(iddDoc, extDoc, "BaselineService",
"com.betfair.baseline", ".", "/target/generated-sources", log,
new Service().getOutputDir(), true, true);
// First let's mangle the document if need be.
if (transform.getManglers() != null) {
log.debug("mangling IDL using "+transform.getManglers().size()+" pre validations");
for(DocumentMangler m : transform.getManglers()) {
log.debug(m.getName());
reader.mangle(m);
}
log.debug(reader.serialize());
}
for (Validator v: transform.getPreValidations()) {
reader.validate(v);
}
log.debug(reader.serialize());
reader.runMerge(transform.getTransformations());
reader.writeResult();
}