File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import typing
77import sys
88
9+ def read_version (version_file : Path ) -> str :
10+ # First, if environment variable UDS_VERSION is set, use it
11+ env_version = os .environ .get ("UDS_VERSION" )
12+ if env_version :
13+ return env_version .strip ()
14+ # Otherwise, read from the VERSION file
15+ if version_file .exists ():
16+ return version_file .read_text ().strip ()
17+ return "DEVEL"
18+
19+
920SCRIPT_DIR : typing .Final [Path ] = Path (__file__ ).resolve ().parent
1021WORKSPACE_ROOT : typing .Final [Path ] = SCRIPT_DIR .parent .parent .resolve ()
1122OUTPUT_DIR : typing .Final [Path ] = SCRIPT_DIR / "package"
1223BUILD_ROOT : typing .Final [Path ] = SCRIPT_DIR / "build-root"
1324
1425VERSION_FILE : typing .Final [Path ] = WORKSPACE_ROOT .parent / "VERSION"
15- VERSION : typing .Final [str ] = VERSION_FILE . read_text (). strip () if VERSION_FILE . exists () else "DEVEL"
26+ VERSION : typing .Final [str ] = read_version ( VERSION_FILE )
1627BINARIES : typing .Final [list [str ]] = [
1728 "udsactor-client" ,
1829 "udsactor-service" ,
You can’t perform that action at this time.
0 commit comments