]> git.tdb.fi Git - builder.git/blobdiff - source/cli/buildercli.h
Rearrange sources into subdirectories
[builder.git] / source / cli / buildercli.h
diff --git a/source/cli/buildercli.h b/source/cli/buildercli.h
new file mode 100644 (file)
index 0000000..f4b2ad7
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef BUILDERCLI_H_
+#define BUILDERCLI_H_
+
+#include <msp/builder/builder.h>
+#include <msp/core/application.h>
+
+class Analyzer;
+
+/**
+Provides a command-line interface for Builder.
+*/
+class BuilderCLI: public Msp::RegisteredApplication<BuilderCLI>
+{
+private:
+       std::vector<std::string> cmdline_targets;
+       Config::InputOptions cmdline_options;
+       Msp::FS::Path cwd;
+
+       Builder builder;
+       Logger logger;
+       Analyzer *analyzer = 0;
+       bool build = false;
+       unsigned clean = 0;
+       bool dry_run = false;
+       bool help = false;
+       std::string helpmsg;
+       bool show_progress = false;
+       std::string build_file = "Build";
+       unsigned jobs = 1;
+       std::vector<std::string> what_if;
+       bool conf_all = false;
+       bool conf_only = false;
+       bool build_all = false;
+       bool create_makefile = false;
+
+public:
+       BuilderCLI(int, char **);
+       ~BuilderCLI();
+
+       int main() override;
+
+private:
+       bool prepare_build();
+       Target *resolve_target(const std::string &);
+
+       void package_help();
+};
+
+#endif