summaryrefslogtreecommitdiffhomepage
path: root/xmake.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2024-05-03 12:24:13 +0200
committerRoland Reichwein <mail@reichwein.it>2024-05-03 12:24:13 +0200
commit6669794434cb9f472aafce126162b9b81389df5f (patch)
treeeb0bce92f42648784cecf704f1a7569ca30b1ba6 /xmake.cpp
parent5ecd32cb842defe38e14dcaeb0caa2d98356a0bb (diff)
Rename to ymake
Diffstat (limited to 'xmake.cpp')
-rw-r--r--xmake.cpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/xmake.cpp b/xmake.cpp
deleted file mode 100644
index 5a12bb4..0000000
--- a/xmake.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-#include "xmake.h"
-
-#include "builder.h"
-
-#include <algorithm>
-#include <cstdlib>
-#include <filesystem>
-#include <iostream>
-#include <iterator>
-#include <sstream>
-#include <stack>
-#include <stdexcept>
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-#include <vector>
-
-#include <boost/property_tree/ptree.hpp>
-#include <boost/property_tree/xml_parser.hpp>
-#include <boost/process.hpp>
-
-#include <fmt/format.h>
-
-#include <libreichwein/file.h>
-#include <libreichwein/stringhelper.h>
-
-namespace fs = std::filesystem;
-namespace bp = boost::process;
-namespace pt = boost::property_tree;
-using namespace std::string_literals;
-
-namespace {
- const fs::path XMakefile{"XMakefile"};
-
- void usage()
- {
- std::cout << "Usage: xmake <target>" << std::endl;
- }
-
-}
-
-int xmake(int argc, char* argv[])
-{
- try {
- pt::ptree ptree;
- pt::read_xml(XMakefile, ptree, pt::xml_parser::no_comments | pt::xml_parser::trim_whitespace);
-
- std::string action{"default"};
-
- if (argc == 1) { // default action
- } else if (argc == 2) {
- action = argv[1];
- } else {
- std::cerr << "Invalid arguments." << std::endl;
- usage;
- exit(1);
- }
-
- Builder builder(ptree);
- if (action == "default"s || action == "build") { // build
- builder.build();
- } else if (action == "clean") {
- builder.clean();
- } else if (action == "install") {
- throw std::runtime_error("unimplemented");
- } else if (action == "rebuild") {
- throw std::runtime_error("unimplemented");
- } else if (action == "run") {
- throw std::runtime_error("unimplemented");
- } else {
- std::cerr << "Invalid action: " << action << std::endl;
- usage;
- exit(1);
- }
-
- } catch (const std::exception& ex) {
- std::cerr << "xmake: " << ex.what() << std::endl;
- return 1;
- }
-
- return 0;
-}
-