Skip to content

Commit

Permalink
Merge branch 'release-candidate' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
hedger committed Jul 11, 2024
2 parents c898427 + 8573d02 commit 093ab78
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.11]
python-version: [3.8, 3.11, 3.12]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.5
0.2.6
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ authors = [{ name = "Flipper Devices Inc.", email = "[email protected]" }]
description = "uFBT - micro Flipper Build Tool. Tool for building and developing applications (.fap) for Flipper Zero and its device family."
readme = "README.md"
requires-python = ">=3.8"
dependencies = ["oslex>=0.1.3"]
keywords = ["ufbt", "flipperzero", "fbt", "stm32", "fap"]
license = { text = "GPL-3.0" }
classifiers = [
Expand All @@ -26,7 +27,6 @@ classifiers = [
"Operating System :: POSIX :: Linux",
]


[project.urls]
homepage = "https://github.com/flipperdevices/flipperzero-ufbt"
documentation = "https://github.com/flipperdevices/flipperzero-ufbt"
Expand Down
34 changes: 21 additions & 13 deletions ufbt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import pathlib
import platform
import sys
import oslex

from .bootstrap import (
DEFAULT_UFBT_HOME,
Expand Down Expand Up @@ -83,30 +84,37 @@ def ufbt_cli():
if not os.path.exists(ufbt_state_dir / "current"):
bootstrap_cli(["update"])

if not (ufbt_state_dir / "current" / "scripts" / "ufbt").exists():
if not (
ufbt_script_root := ufbt_state_dir / "current" / "scripts" / "ufbt"
).exists():
print("SDK is missing scripts distribution!")
print("You might be trying to use an SDK in an outdated format.")
print("Run `ufbt update -h` for more information on how to update.")
print("You can clean up current state with `ufbt clean --purge`.")
print("Run `ufbt update -h` for more information on SDK installation.")
return 1

UFBT_APP_DIR = os.getcwd()

if platform.system() == "Windows":
commandline = (
r'call "%UFBT_STATE_DIR%/current/scripts/toolchain/fbtenv.cmd" env & '
"python -m SCons -Q --warn=target-not-built "
r'-C "%UFBT_STATE_DIR%/current/scripts/ufbt" '
f'"UFBT_APP_DIR={UFBT_APP_DIR}" ' + " ".join(sys.argv[1:])
)

commandline = r'call "%UFBT_STATE_DIR%/current/scripts/toolchain/fbtenv.cmd" env & python '
else:
commandline = (
'. "$UFBT_STATE_DIR/current/scripts/toolchain/fbtenv.sh" && '
"python3 -m SCons -Q --warn=target-not-built "
'-C "$UFBT_STATE_DIR/current/scripts/ufbt" '
f'"UFBT_APP_DIR={UFBT_APP_DIR}" ' + " ".join(sys.argv[1:])
'. "$UFBT_STATE_DIR/current/scripts/toolchain/fbtenv.sh" && python3 '
)

commandline += oslex.join(
[
"-m",
"SCons",
"-Q",
"--warn=target-not-built",
"-C",
str(ufbt_script_root),
f"UFBT_APP_DIR={UFBT_APP_DIR}",
*sys.argv[1:],
]
)

# print(commandline)
retcode = os.system(commandline)
if platform.system() != "Windows":
Expand Down

0 comments on commit 093ab78

Please sign in to comment.