platformio/platformio-core

Hook after Clean

Open

#4,456 创建于 2022年11月11日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)Python (791 fork)batch import
build systemhelp wanted

仓库指标

Star
 (7,329 star)
PR 合并指标
 (平均合并 109天 16小时) (30 天内合并 5 个 PR)

描述

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

贡献者指南