beeware / beeware/briefcase

Add plugin interface for custom build steps

Open
#2,933 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.3k
Forks
549
Avg merge
1d 4h
Merged PRs (30d)
40

Description

### What is the problem or limitation you are having?

We've had a number of requests to add customised steps into the build process:

* #436 - Running PySide "resource build" steps
* #1865 - Run obfuscation tooling over an app
* glyph/Encrust#2 - Compiling XIB files in a macOS project with ibtool

These are not necessarily processes that Briefcase should support out of the box, but there is clearly a need to support them. Briefcase should provide a plugin interface to allow libraries to add custom steps to the build.

### Describe the solution you'd like

A third party package should be able to register an entry point that will be invoked as part of the build command.

A post-build hook would be the bare minimum; it might make sense to expose a pre-build hook as well. Presumably these two entry points would be invoked before and after the `BuildCommand.build_app()` invocation as part of `_build_app()`.

The call to the plugin should be given the full BuildCommand as an argument, so that plugins can access tools, utility methods like `build_path()` etc.

### Describe alternatives you've considered

It might make sense to expose other entry points (pre/post-create, pre/post-run, pre/post-package etc).

As a convenience (stemming from the original feature request from #436), having a default plugin can run bare shell commands may be useful.

### Additional context

The interaction with Docker-based Linux builds may be a complication.

Contributor guide

Open the contributing guide

Research direction

Start by tracing _build_app() and BuildCommand.build_app() to understand where build hooks could run, then inspect how Briefcase discovers command entry points. Consider the Docker-based Linux build path and determine how a third-party package receives the full BuildCommand. Done means the plugin interface and its invocation points are defined and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.