Rebuild Option
- Rebuild option is added
This commit is contained in:
@@ -20,6 +20,7 @@ OBJDetect is a program made in Go as an example of how to use [unildd](https://g
|
|||||||
|
|
||||||
```
|
```
|
||||||
python3 build.py --build # To build the program
|
python3 build.py --build # To build the program
|
||||||
|
python3 build.py --rebuild # To rebuild the program
|
||||||
python3 build.py --run # To directly run the program
|
python3 build.py --run # To directly run the program
|
||||||
python3 build.py --clean # To remove the build directory
|
python3 build.py --clean # To remove the build directory
|
||||||
```
|
```
|
||||||
|
|||||||
7
build.py
7
build.py
@@ -3,6 +3,7 @@ from os.path import exists
|
|||||||
from sys import argv, stderr
|
from sys import argv, stderr
|
||||||
from platform import system as os_name
|
from platform import system as os_name
|
||||||
|
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
system("mkdir -p build")
|
system("mkdir -p build")
|
||||||
system("git clone https://github.com/nix-enthusiast/unildd.git build/unildd")
|
system("git clone https://github.com/nix-enthusiast/unildd.git build/unildd")
|
||||||
@@ -14,7 +15,7 @@ def build():
|
|||||||
if not exists("include"):
|
if not exists("include"):
|
||||||
system("mkdir include")
|
system("mkdir include")
|
||||||
|
|
||||||
# I know this logic is dodgy
|
# I know this logic is dodgy
|
||||||
match os_name():
|
match os_name():
|
||||||
case "Windows":
|
case "Windows":
|
||||||
system("cp build\\unildd\\target\\release\\libunildd.dll lib")
|
system("cp build\\unildd\\target\\release\\libunildd.dll lib")
|
||||||
@@ -25,6 +26,7 @@ def build():
|
|||||||
|
|
||||||
system("cp build/unildd/header/unildd.h include")
|
system("cp build/unildd/header/unildd.h include")
|
||||||
|
|
||||||
|
|
||||||
match argv[1]:
|
match argv[1]:
|
||||||
case "--build" | "-b":
|
case "--build" | "-b":
|
||||||
build()
|
build()
|
||||||
@@ -37,5 +39,8 @@ match argv[1]:
|
|||||||
case "--clean" | "-c":
|
case "--clean" | "-c":
|
||||||
system("rm -rf build")
|
system("rm -rf build")
|
||||||
|
|
||||||
|
case "--rebuild" | "-r":
|
||||||
|
system("go build -o build/objdetect")
|
||||||
|
|
||||||
case f:
|
case f:
|
||||||
print("Invalid flag '" + f + "'", file=stderr)
|
print("Invalid flag '" + f + "'", file=stderr)
|
||||||
|
|||||||
Reference in New Issue
Block a user