
htmlcompiler.commands.Compile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of htmlcompiler Show documentation
Show all versions of htmlcompiler Show documentation
An HTML compiler, with maven plugin
package htmlcompiler.commands;
import htmlcompiler.compilers.HtmlCompiler;
import htmlcompiler.pojos.library.LibraryArchive;
import htmlcompiler.tools.Logger;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Map;
import static htmlcompiler.compilers.TemplateThenCompile.compileDirectories;
import static htmlcompiler.compilers.TemplateThenCompile.newTemplateThenCompile;
import static htmlcompiler.pojos.compile.CompilerConfig.readChecksConfiguration;
public enum Compile {;
public static class CompileCommandConfig {
public String validation;
public Path inputDir;
public Path outputDir;
public boolean replaceExtension;
public Map variables;
public Path baseDir;
public boolean recursive;
}
public static void executeCompile(final Logger log, final CompileCommandConfig config) throws IOException {
final var libs = new LibraryArchive();
final var checksSettings = readChecksConfiguration(config.validation);
final var html = new HtmlCompiler(log, libs, checksSettings);
final var ttc = newTemplateThenCompile(log, config.inputDir, config.outputDir, config.replaceExtension, config.variables, html);
compileDirectories(config.inputDir, ttc, config.recursive);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy