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