Skip to content

Commit c7ab91b

Browse files
committed
Merge remote-tracking branch 'remotes/origin/dev' into release-candidate
2 parents 7d66ba0 + ce80646 commit c7ab91b

29 files changed

+905
-1646
lines changed

.gitattributes

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/pypi-publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
deploy:
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: '3.8'
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install build
28+
- name: Build package
29+
run: python -m build
30+
- name: Publish package
31+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
32+
with:
33+
user: __token__
34+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
# State dir
2-
.ufbt
3-
4-
# Created by https://www.toptal.com/developers/gitignore/api/python,scons,c++,visualstudiocode,c
5-
# Edit at https://www.toptal.com/developers/gitignore?templates=python,scons,c++,visualstudiocode,c
6-
71
### Python ###
82
# Byte-compiled / optimized / DLL files
93
__pycache__/
104
*.py[cod]
11-
*$py.class
12-
13-
# C extensions
145

156
# Distribution / packaging
167
.Python
@@ -32,87 +23,10 @@ share/python-wheels/
3223
*.egg
3324
MANIFEST
3425

35-
# PyInstaller
36-
# Usually these files are written by a python script from a template
37-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38-
*.manifest
39-
*.spec
40-
41-
# Installer logs
42-
pip-log.txt
43-
pip-delete-this-directory.txt
44-
45-
# Unit test / coverage reports
46-
htmlcov/
47-
.tox/
48-
.nox/
49-
.coverage
50-
.coverage.*
51-
.cache
52-
nosetests.xml
53-
coverage.xml
54-
*.cover
55-
*.py,cover
56-
.hypothesis/
57-
.pytest_cache/
58-
cover/
59-
60-
# IPython
61-
profile_default/
62-
ipython_config.py
63-
64-
# pyenv
65-
# For a library or package, you might want to ignore these files since the code is
66-
# intended to run in multiple environments; otherwise, check them in:
67-
# .python-version
68-
69-
# pipenv
70-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
71-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
72-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
73-
# install all needed dependencies.
74-
#Pipfile.lock
75-
76-
# poetry
77-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
78-
# This is especially recommended for binary packages to ensure reproducibility, and is more
79-
# commonly ignored for libraries.
80-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
81-
#poetry.lock
82-
83-
# pdm
84-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
85-
#pdm.lock
86-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
87-
# in version control.
88-
# https://pdm.fming.dev/#use-with-ide
89-
.pdm.toml
90-
91-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
92-
__pypackages__/
93-
94-
95-
# Environments
96-
.env
97-
.venv
98-
env/
99-
venv/
100-
ENV/
101-
env.bak/
102-
venv.bak/
103-
104-
# mkdocs documentation
105-
/site
106-
107-
10826
### SCons ###
10927
# for projects that use SCons for building: http://http://www.scons.org/
11028
.sconsign.dblite
11129

112-
# When configure fails, SCons outputs these
113-
config.log
114-
.sconf_temp
115-
11630
### VisualStudioCode ###
11731
.vscode/*
11832
!.vscode/settings.json
@@ -123,13 +37,3 @@ config.log
12337

12438
# Local History for Visual Studio Code
12539
.history/
126-
127-
# Built Visual Studio Code Extensions
128-
*.vsix
129-
130-
### VisualStudioCode Patch ###
131-
# Ignore all local history of files
132-
.history
133-
.ionide
134-
135-
# End of https://www.toptal.com/developers/gitignore/api/python,scons,c++,visualstudiocode,c

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": true
3+
}

README.md

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
# uFBT - micro Flipper Build Tool
22

3-
uFBT is a tool for building applications for Flipper Zero. It is a simplified version of [Flipper Build Tool (FBT)](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/documentation/fbt.md).
4-
5-
uFBT allows you to perform basic development tasks for Flipper Zero, like building and debugging applications, flashing firmware. It uses prebuilt binaries and libraries, so you don't need to build the whole firmware to compile and debug your application.
3+
uFBT is a cross-platform tool for building applications for [Flipper Zero](https://flipperzero.one/). It is a simplified version of [Flipper Build Tool (FBT)](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/documentation/fbt.md).
64

5+
uFBT enables basic development tasks for Flipper Zero, such as building and debugging applications, flashing firmware, creating VSCode development configurations. It uses prebuilt binaries and libraries, so you don't need to build [the whole firmware](https://github.com/flipperdevices/flipperzero-firmware) to compile and debug your application for Flipper.
76

87
## Installation
98

10-
Clone this repository and add its path to your `PATH` environment variable. On first run, uFBT will download and install all required SDK components from `dev` branch of official firmware.
11-
12-
### Updating the SDK
9+
- **Linux & macOS**: `python3 -m pip install --upgrade ufbt`
10+
- **Windows**: `py -m pip install --upgrade ufbt`
1311

14-
To update the SDK, run `ufbt update`. This will download and install all required SDK components from previously used channel or branch.
12+
uFBT uses your system's Python for running bootstrap code. Minimal supported version is **Python 3.8**. For executing actual build tasks, uFBT will download and use its own Python binaries and a toolchain built for your platform.
1513

16-
To switch to a different version of the SDK, run `ufbt update --channel=[dev|rc|release]`. Or you can use any not-yet-merged branch from official repo, like `ufbt update --branch=feature/my-awesome-feature`.
17-
18-
If something goes wrong and uFBT state becomes corrupted, you can reset it by running `ufbt purge`. If that doesn't work, you can try removing `.ufbt` subfolder manually from ufbt's folder.
14+
On first run, uFBT will download and install required SDK components from `release` update channel of official firmware. For more information on how to switch to a different version of the SDK, see [Managing the SDK](#managing-the-sdk) section.
1915

2016
## Usage
2117

2218
### Building & running your application
2319

2420
Run `ufbt` in the root directory of your application (the one with `application.fam` file in it). It will build your application and place the resulting binary in `dist` subdirectory.
2521

26-
You can upload and start your application on Flipper attached over USB using `ufbt launch`.
22+
You can upload and start your application on Flipper attached over USB using `ufbt launch`.
23+
24+
To see other available commands and options, run `ufbt -h`.
2725

2826
### Debugging
2927

@@ -38,9 +36,34 @@ uFBT provides a configuration for VSCode that allows you to build and debug your
3836
### Application template
3937

4038
uFBT can create a template for your application. To do this, run `ufbt create APPID=<app_id>` in the directory where you want to create your application. It will create an application manifest and its main source file. You can then build and debug your application using the instructions above.
39+
4140
Application manifests are explained in the [FBT documentation](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/documentation/AppManifests.md).
4241

4342
### Other
4443

4544
* `ufbt cli` starts a CLI session with the device;
4645
* `ufbt lint`, `ufbt format` run clang-format on application's sources.
46+
47+
## Managing the SDK
48+
49+
To update the SDK, run `ufbt update`. This will download and install all required SDK components from previously used source.
50+
51+
- To switch to SDK for a different **release channel**, run `ufbt update --channel=[dev|rc|release]`.
52+
- uFBT also supports 3rd-party update indexers, following the same schema as [official firmware](https://github.com/flipperdevices/flipperzero-firmware). To use them, run `ufbt update --index-url=<url>`, where `<url>` is a URL to the index file, e.g. `https://update.flipperzero.one/firmware/directory.json`.
53+
- To use SDK for a **certain release** or a not-yet-merged **branch** from official repo, run `ufbt update --branch=0.81.1` or `ufbt update --branch=owner/my-awesome-feature`.
54+
- You can also use branches from other repos, where build artifacts are available from an indexed directory, by specifying `--index-url=<url>`.
55+
- uFBT can also download and update the SDK from any **fixed URL**. To do this, run `ufbt update --url=<url>`.
56+
- To use a **local copy** of the SDK, run `ufbt update --local=<path>`. This will use the SDK located in `<path>` instead of downloading it. Useful for testing local builds of the SDK.
57+
58+
uFBT stores its state in `.ufbt` subfolder in your home directory. You can override this location by setting `UFBT_HOME` environment variable.
59+
60+
61+
### ufbt-bootstrap
62+
63+
Updating the SDK is handled by uFBT component called _bootstrap_. It has a dedicated entry point, `ufbt-bootstrap`, with additional options that might be useful in certain scenarios. Run `ufbt-bootstrap --help` to see them.
64+
65+
## Troubleshooting
66+
67+
If something goes wrong and uFBT state becomes corrupted, you can reset it by running `ufbt clean`. If that doesn't work, you can try removing `.ufbt` subfolder manually from your home folder.
68+
69+
`ufbt-bootstrap` and SDK-related `ufbt` subcommands accept `--verbose` option that will print additional debug information.

0 commit comments

Comments
 (0)