26 Commits

Author SHA1 Message Date
Maxim Prokhorov
c5a0b5f23f build(scripts): allow to generate compile_commands.json with everything enabled 2025-06-24 23:55:41 +03:00
Maxim Prokhorov
05513b5d63 pio: uninstall one package at a time
amend 7c2130b722
since install skips deps, skip them in uninstall as well
2025-01-14 19:42:20 +03:00
Maxim Prokhorov
46f4eef428 pio: auth as literal string
ref. https://scons.org/doc/production/HTML/scons-user.html#f-Literal
> The specified string will be preserved as-is and not have construction variables expanded.

resolve #1498
2024-08-30 15:49:30 +03:00
Maxim Prokhorov
74ce4d974d pio: update formatting 2022-08-30 03:18:11 +03:00
Maxim Prokhorov
6f122f5ecb pio: debug info in distributed builds and build-and-copy fixes
store objcopy of these extra symbols and .map from the linker
distribution will have an extra debug .zip file that could be used with
the exception decoder

also fixes relative paths in the build-and-copy
(although, yet again loses the pio target in the gui)
2022-08-30 01:33:55 +03:00
Maxim Prokhorov
7c2130b722 pio: prune unused libraries from shared_lib_dir 2022-05-06 15:48:16 +03:00
Maxim Prokhorov
5ccc70e42e pio: trying to work out 6.0.0 changes 2022-05-05 17:50:21 +03:00
Maxim Prokhorov
c0c3dcdc1d ir: include typos 2021-11-30 03:20:13 +03:00
Maxim Prokhorov
c738b91b6a pio: simplify single-source builder
Generate resulting .cpp in the $BUILD_DIR, no need for atexit
Register middleware only once, there's no need to manually walk the
project directory since fnmatch.fnmatch(...) supports globs

Provide a SCons Action instead of simple function, so there's a way to
generate things on demand via command line
```
$ pio run -e $env -t .pio/build/$env/espurna_single_source/src/main.cpp
```
2021-11-30 00:06:24 +03:00
Maxim Prokhorov
79321b6707 ci: directly use the test build headers
- just pass `-include ${cfg}` to the compiler instead of a
  temporary custom.h. also do `-DDEVICE=...` and `-DMANUFACTURER=...`
- rework test_build to print using `logging` module
- report leftover configurations, after the failed one exits
- prettify the output and highlight relevant info instead of the whole lines
2021-11-29 23:06:03 +03:00
Maxim Prokhorov
cf0315c231 scripts: formatting 2021-10-03 20:44:58 +03:00
Maxim Prokhorov
001ec79c8e ir: clean-up and refactoring of the existing module
- provide a queue for the outgoing messages, don't depend on the MQTT
  callback implementation details and always postpone the actual transfer.
- generate user input parsers using re2c, adds special PlatformIO build handlers
- add terminal command to show GPIO info and send a simple payload
- rework button<->action presets into value<->terminal command presets and custom ones
  through the use of `irCmd<VALUE>` settings, where the VALUE is taken from the simple payload
  (yet, it does not understand repeated codes, but that's something to add later *or* use rpnlib)
- add tx message integration for the relay module via `irRelayOn#` and `irRelayOff#`
- rework simple payload to include 'repeats' value for the 'IRsend::send()'
  also adds internal 'series', 'delay' and includes full 64bit 'value'
  (as uppercase HEX, instead of decimal)
- rework raw payload to use 'series' instead of 'repeats', and provide a
  clear distinction between the usec time and the options of the message
  by moving the required options to the front and separating them using ':'
  (just like the simple variant)
- make RX and TX pin a runtime setting, make RX and TX support a build flag
- small test framework to check whether internal string encode<->decode works

Also updates the hexEncode & hexDecode implementations to use
'iterators' instead of just pointer + index.
2021-10-03 20:44:58 +03:00
Maxim Prokhorov
bacff3102d pio: make sure "y" for shared libs still works
And update other options to support y, yes and true
2021-06-20 17:41:46 +03:00
Maxim Prokhorov
f18f128e4b pio: consistent shared libs location
Do not install libraries globally in CI, use the specified PIO .ini option.
Similar to the other package installers, prefer package cache to the actual library storage contents.
2021-06-19 12:52:10 +03:00
Maxim Prokhorov
4c33cacfdb pio: add build-and-copy, more configuration options for version
Multiple ways to specify version string through environment variables:
- `ESPURNA_BUILD_FULL_VERSION` to set full version string
By default it is empty, and the version is combined using the values specified below
- `ESPURNA_BUILD_VERSION` to modify the first part of the version string (1.15.0-dev)
By default, uses espurna/config/version.h APP_VERSION value
- `ESPURNA_BUILD_REVISION` to specify revision part of the version string
For example 12345678, which is expanded as either .git12345678 or -git12345678
(depending on whether the version string contains hyphen)
By default, use git to retrieve the first 8 characters of the current HEAD SHA value
- `ESPURNA_BUILD_VERSION_SUFFIX` to specify build metadata part of the string
For example nightly20210607, which is added to the full version as 1.15.0-dev+nightly20210607
Empty by defauld

Adds -t build-and-copy which uses the values above to copy firmware.bin, configurable with:
- `ESPURNA_BUILD_NAME` to set the suffix of the filename.
By default, uses the $PIOENV (aka the string after the env: in the .ini file)
- `ESPURNA_BUILD_DESTINATION` to specify where to copy the .bin files
By default, uses $PROJECT_DIR

Resulting file is stored at:
${ESPURNA_BUILD_DESTINATION}/${ESPURNA_BUILD_FULL_VERSION}/espurna-${ESPURNA_BUILD_FULL_VERSION}-${ESPURNA_BUILD_NAME}.bin

In addition, modify generate_release_sh.py to use the new environment variables.
2021-06-07 03:54:28 +03:00
Maxim Prokhorov
7817e3abd5 pio: accept external revision string 2021-01-20 23:35:36 +03:00
Maxim Prokhorov
3a34d555d5 ci: don't mention travis 2021-01-14 18:11:14 +03:00
Maxim Prokhorov
3287dbcee7 pio: small helper to use libdeps installer 2020-12-15 01:02:45 +03:00
Maxim Prokhorov
850db61b76 pio: filter single-source files by absolute path
Specifically, this will break RFM69_SUPPORT on case insensitive
filesystems due to the RFM69.cpp from the RFM69 lib being ignored
when adding ESPurna's rfm69.cpp
2020-11-16 10:52:54 +03:00
Maxim Prokhorov
8e49523710 test: add --no-single-source to check whether normal build process works 2020-07-16 05:27:42 +03:00
Max Prokhorov
cb8443dfa3 Use #include for single source build (#2267)
* [1/2] use #include for single source

* [2/2] use #include for single source
2020-05-31 05:48:47 +03:00
Max Prokhorov
edb23dbfc4 Convert .ino -> .cpp (#2228)
- general conversion from .ino modules into a separate .cpp files
- clean-up internal headers, place libraries into .h. guard .cpp with _SUPPORT flags 
- fix some instances of shared variables instead of public methods
- tweak build system to still build a single source file via os environment variable ESPURNA_BUILD_SINGLE_SOURCE
2020-04-30 13:55:07 +03:00
Maxim Prokhorov
492a35926f ci: rework build.sh & release.sh generator
- don't depend on TRAVIS environment variables
- depend on CI flag to add release variables
- chmod +x
2020-04-08 23:28:43 +03:00
Max Prokhorov
db50be91bc PIO: fix env definitions (again) (#2212)
* base envs

* CI: speed up release process (since we still want some .bin files)

* fixup! CI: speed up release process (since we still want some .bin files)

* release dry run

* fixup! release dry run

* adjust

* fix .bin name

* it works

* minor cleanup for current git

* use pio suggestion about ldscript, reduce build_flags impact

* fix linker

* parse ${vars} instead of ignoring them

* add filtering and override file (sneak peak into tasmota's pio config)

* don't generate secure client (for now)

* formatting

* codacy
2020-04-07 21:20:32 +03:00
Max Prokhorov
a4d4231ae0 PIO: remove -ota envs, handle OTA condition in extra script (#2099)
* PIO: remove -ota envs, handle OTA condition in extra script
* Tweak ESPURNA_BOARD variable
* Support git and latest in ota script
* Handle ESPURNA_FLAGS too
* Try to handle env and projenv in pylint
* Add deprecation comment about -ota envs
* regen arduino.h
2020-01-20 17:41:10 +03:00
Max Prokhorov
c18490cc4a PIO: pass APP_REVISION via extra scripts (#1946)
* utils/version: use git description token as version, add memoization

* pio: move extra scripts to a separate directory

* pio: add -DAPP_REVISION=... as local build flag
2019-10-16 14:41:43 +03:00