MarkupTemplateEngine provideTemplateEngine(LaunchConfig launchConfig, Config config) {
ClassLoader parent = getClass().getClassLoader();
TemplateConfiguration effectiveConfiguration = new TemplateConfiguration(config);
effectiveConfiguration.setCacheTemplates(config.isCacheTemplates()); // not copied by constructor
Path templatesDir = launchConfig.getBaseDir().file(config.getTemplatesDirectory());
return new MarkupTemplateEngine(parent, effectiveConfiguration, new CachingTemplateResolver(templatesDir));
}