Skip to content

Commit

Permalink
Provide a more extensive default bootstrap beeware#2006
Browse files Browse the repository at this point in the history
  • Loading branch information
Xzenergy committed Oct 23, 2024
1 parent 8b7c343 commit 79eaa96
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 12 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ filterwarnings = [
"error",
]

[tool.briefcase]
bootstraps = ["toga", "empty"] # Add "empty" to the list of bootstraps

# need to ensure build directories aren't excluded from recursion
norecursedirs = []

Expand Down
Empty file.
22 changes: 22 additions & 0 deletions src/briefcase/bootstraps/empty/empty.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Configuration for an empty bootstrap

# macOS configuration
[macOS]
# Delete the next line to support macOS
supported = false
requires = [
# Python requirements for macOS
]

# Linux configuration
[Linux]
system_requires = [
# System packages needed to run the app on Linux
]
system_runtime_requires = [
# System runtime packages needed to run the app on Linux
]

# Windows configuration
[Windows]
# Add any platform-specific configuration here
24 changes: 13 additions & 11 deletions src/briefcase/commands/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,17 +593,19 @@ def build_app_context(self, project_overrides):
"license": project_license,
}

def build_gui_context(
self,
context: dict[str, str],
project_overrides: dict[str, str],
) -> dict[str, str]:
# We must set the GUI-framework to None here since the convert-command uses the new-command
# template. This template includes dependencies for the GUI-frameworks. However, if a project
# already is set up for a GUI-framework, then those dependencies should already be listed.
# To prevent the same dependency being listed twice (once in the PEP621-section and once in the
# briefcase-section), possibly with different versions, we set the GUI-framework to None here.
return {"gui_framework": "None"}
def build_gui_context(self, app, platform, output_format):
if app.gui_framework == "empty":
#Handle the empty bootstrap option
context = {
"platform": platform,
"output_format": output_format,
#Add any context that is needed for the empty bootstrap
}
else:
#Existing logic for Toga or other frameworks
context = super().build_gui_context(app, platform, output_format)

return context

def merge_or_copy_pyproject(self, briefcase_config_file: Path) -> None:
"""Merge pyproject.toml file made by the cookiecutter with the one in the
Expand Down
8 changes: 7 additions & 1 deletion src/briefcase/commands/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,13 @@ def build_app_context(self, project_overrides: dict[str, str]) -> dict[str, str]
"url": url,
"license": project_license,
}

#Added modify GUI choices
def _gui_bootstrap_choices(self):
return [
("toga", "Toga (Recommended)"),
("empty", "Empty (Barebones configuration)"), # Add this line
]

def build_gui_context(
self,
context: dict[str, str],
Expand Down

0 comments on commit 79eaa96

Please sign in to comment.