-
Notifications
You must be signed in to change notification settings - Fork 0
/
cobalt
executable file
·30 lines (27 loc) · 1.18 KB
/
cobalt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python3
# Cobalt Build System - 0.0.4
# Copyright (C) 2020, 2021 Ayush Bardhan Tripathy.
# This project is licensed under MIT License (See LICENSE.md).
# Version info (change-log)
#
# 0.0.4 - Support for C++ projects. New command: generate. Run command can now pass on args. Bug fixes. Removed
# the installation Makefile
# 0.0.3 - Improved dependency loading and project defaults. Defaulted build path to 'builddir', using relative paths.
# New commands: clean, rebuild
# 0.0.2 - Switched to generating Ninja files instead of building itself. Bug fixes. Added a Makefile for
# system wide installation
# 0.0.1 - Initial public release
import os, sys, subprocess;
cobalt_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "tools", "cobalt");
if not os.path.isdir(cobalt_path):
gitlink = "https://github.com/iddev5/cobalt.git";
print("Cobalt build system not found. Cloning from", gitlink);
subprocess.call(["git", "clone", gitlink, cobalt_path]);
sys.path.insert(0, cobalt_path);
try:
from src import main;
except ImportError:
print("Cannot use Cobalt build system");
sys.exit(-1);
if __name__ == "__main__":
main.run(sys.argv);