Switch to using separate untracked build.py.

This commit is contained in:
Matthew Stratford 2021-04-11 20:27:46 +01:00
parent d511f1774d
commit 2b138607fd
6 changed files with 11 additions and 10 deletions

1
.gitignore vendored
View file

@ -21,6 +21,7 @@ build/build/BAPSicle/
build/output/ build/output/
build.py
venv/ venv/

View file

@ -2,8 +2,7 @@
cd "$(dirname "$0")" cd "$(dirname "$0")"
build_commit="$(git rev-parse --short HEAD)" build_commit="$(git rev-parse --short HEAD)"
echo "$build_commit" echo "BUILD: str = \"$build_commit\"" > ../build.py
sed -i "s/BUILD_COMMIT/$build_commit/" ../config.py
apt install libportaudio2 apt install libportaudio2

View file

@ -2,7 +2,7 @@
cd "$(dirname "$0")" cd "$(dirname "$0")"
build_commit="$(git rev-parse --short HEAD)" build_commit="$(git rev-parse --short HEAD)"
echo "$build_commit" echo "BUILD: str = \"$build_commit\"" > ../build.py
sed -i '' -e "s/BUILD_COMMIT/$build_commit/" "../config.py" sed -i '' -e "s/BUILD_COMMIT/$build_commit/" "../config.py"
python3 -m venv ../venv python3 -m venv ../venv

View file

@ -1,11 +1,10 @@
cd /D "%~dp0" cd /D "%~dp0"
: Get the git commit and write it into config.py. : Get the git commit and write it into build.py.
FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO ( FOR /F "tokens=* USEBACKQ" %%F IN (`git rev-parse --short HEAD`) DO (
SET build_commit=%%F SET build_commit=%%F
) )
echo "BUILD: str = \"%build_commit%\""> ..\build.py
(Get-Content "..\config.py") -replace 'BUILD_COMMIT', '%build_commit%' | Out-File -encoding ASCII "..\config.py"
py -m venv ..\venv py -m venv ..\venv
..\venv\Scripts\activate ..\venv\Scripts\activate

View file

@ -1,3 +1,2 @@
# BAPSicle Details # BAPSicle Details
VERSION: str = "0.1.0" VERSION: str = "0.1.0"
BUILD: str = "2bc61be"

View file

@ -34,6 +34,9 @@ if not isMacOS():
# Rip, this doesn't like threading on MacOS. # Rip, this doesn't like threading on MacOS.
import pyttsx3 import pyttsx3
if isBundelled():
import build
import config import config
from typing import Dict, List from typing import Dict, List
from helpers.state_manager import StateManager from helpers.state_manager import StateManager
@ -56,8 +59,8 @@ class BAPSicleServer:
default_state = { default_state = {
"server_version": config.VERSION, "server_version": "",
"server_build": config.BUILD, "server_build": "",
"server_name": "URY BAPSicle", "server_name": "URY BAPSicle",
"host": "localhost", "host": "localhost",
"port": 13500, "port": 13500,
@ -512,7 +515,7 @@ def startServer():
# TODO: Check these match, if not, trigger any upgrade noticies / welcome # TODO: Check these match, if not, trigger any upgrade noticies / welcome
state.update("server_version", config.VERSION) state.update("server_version", config.VERSION)
if isBundelled(): if isBundelled():
build = config.BUILD build = build.BUILD
else: else:
build = "Dev" build = "Dev"
state.update("server_build", build) state.update("server_build", build)