platformio/platformio-core

Hook after Clean

Open

#4456 aperta il 11 nov 2022

Vedi su GitHub
 (8 commenti) (0 reazioni) (0 assegnatari)Python (791 fork)batch import
build systemhelp wanted

Metriche repository

Star
 (7329 star)
Metriche merge PR
 (Merge medio 109g 16h) (5 PR mergiate in 30 g)

Descrizione

I use BUILD_DIR to compile boot2_stage boot loader of Raspberry Pi Pico but Clean clear only board folder...

I didn't find a solution for hook Clean (after) and I can offer you a small patch:

PlatformBase / base.py

    def on_clean(self, dir):            # <---
        pass

builder / tools / piotarget.py

    print("Done cleaning")
    return build_dir                    # <---

builder / main.py

if env.GetOption("clean") or is_clean_all:
    dir = env.PioClean(is_clean_all)    # <---
    env.PioPlatform().on_clean(dir)     # <---
    env.Exit(0)

platform.py

class MyPlatform(PlatformBase):
    def on_clean(self, dir):
        print('ON_CLEAN', dir) 
# RESULT: 
#   ON_CLEAN .....\.pio\build\test-board

Guida contributor