diff --git a/.github/workflows/update-binary.yml b/.github/workflows/update-binary.yml
index 0418c23..5fb56e3 100644
--- a/.github/workflows/update-binary.yml
+++ b/.github/workflows/update-binary.yml
@@ -53,14 +53,15 @@ jobs:
# Generate the stub app
cd stub
briefcase build windows visualstudio
- echo "Move the binary into the final location"
- mv ./build/stub/windows/visualstudio/x64/Release/Stub.exe ./Stub-${{ env.PYTHON_TAG }}.exe
+ echo "Move the binaries into the final location"
+ mv ./build/console-stub/windows/visualstudio/x64/Release/console-stub.exe ./Console-Stub-${{ env.PYTHON_TAG }}.exe
+ mv "./build/gui-stub/windows/visualstudio/x64/Release/GUI stub.exe" ./GUI-Stub-${{ env.PYTHON_TAG }}.exe
- name: Upload Stub Artefact
uses: actions/upload-artifact@v4.3.3
with:
name: stub-${{ matrix.python-version }}
- path: stub/Stub-${{ env.PYTHON_TAG }}.exe
+ path: stub/*-Stub-${{ env.PYTHON_TAG }}.exe
commit-stubs:
name: Commit Stub Binaries
@@ -75,23 +76,15 @@ jobs:
export BRIEFCASE_VERSION="${TAG%-*}"
export BUILD_NUMBER="${TAG#*-}"
- echo "TAG=${TAG}"
- echo "PYTHON_TAG=${PYTHON_TAG}"
- echo "BRIEFCASE_VERSION=${BRIEFCASE_VERSION}"
- echo "BUILD_NUMBER=${BUILD_NUMBER}"
-
- echo "TAG=${TAG}" >> $GITHUB_ENV
- echo "PYTHON_TAG=${PYTHON_TAG}" >> $GITHUB_ENV
- echo "BRIEFCASE_VERSION=${BRIEFCASE_VERSION}" >> $GITHUB_ENV
- echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV
+ echo "TAG=${TAG}" | tee -a $GITHUB_ENV
+ echo "BRIEFCASE_VERSION=${BRIEFCASE_VERSION}" | tee -a $GITHUB_ENV
+ echo "BUILD_NUMBER=${BUILD_NUMBER}" | tee -a $GITHUB_ENV
if [ "${BRIEFCASE_VERSION}" == "dev" ]; then
# We're on the development template; push to main
- echo "TEMPLATE_BRANCH=main"
- echo "TEMPLATE_BRANCH=main" >> $GITHUB_ENV
+ echo "TEMPLATE_BRANCH=main" | tee -a $GITHUB_ENV
else
- echo "TEMPLATE_BRANCH=v${BRIEFCASE_VERSION}"
- echo "TEMPLATE_BRANCH=v${BRIEFCASE_VERSION}" >> $GITHUB_ENV
+ echo "TEMPLATE_BRANCH=v${BRIEFCASE_VERSION}" | tee -a $GITHUB_ENV
fi
- name: Checkout Template
@@ -108,8 +101,8 @@ jobs:
run: |
git config user.email "brutus@beeware.org"
git config user.name "Brutus (robot)"
- # Move the binary into it's final location
- mv stub/Stub-* "{{ cookiecutter.format }}/src"
+ # Move the binaries into their final location
+ mv stub/*-Stub-* "{{ cookiecutter.format }}/src"
git add "{{ cookiecutter.format }}/src"
git commit -m "AUTO: Update app binaries; build ${{ env.TAG }}"
git push origin HEAD:${{ env.TEMPLATE_BRANCH }}
diff --git a/cookiecutter.json b/cookiecutter.json
index 8ead337..f18e832 100644
--- a/cookiecutter.json
+++ b/cookiecutter.json
@@ -3,16 +3,19 @@
"formal_name": "App Name",
"app_name": "{{ cookiecutter.formal_name|lower|replace(' ', '-') }}",
"module_name": "{{ cookiecutter.app_name|replace('-', '_') }}",
+ "bundle": "com.example",
"version_triple": "0.0.1",
"author": "Example Corporation",
"author_email": "contact@example.com",
"url": "http://example.com",
"description": "Short description of app",
+ "console_app": false,
"guid": "1409c8f5-c276-4cf3-a2fd-defcbdfef9a2",
"install_scope": "",
"use_full_install_path": true,
"python_version": "3.X.0",
"_extensions": [
- "briefcase.integrations.cookiecutter.PythonVersionExtension"
+ "briefcase.integrations.cookiecutter.PythonVersionExtension",
+ "briefcase.integrations.cookiecutter.UUIDExtension"
]
}
diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py
index a6154af..850c639 100644
--- a/hooks/post_gen_project.py
+++ b/hooks/post_gen_project.py
@@ -4,9 +4,12 @@
BIN_PATH = Path("src")
-# Move the stub for the Python version into the final location
-os.rename(BIN_PATH / 'Stub-{{ cookiecutter.python_version|py_tag }}.exe', BIN_PATH / '{{ cookiecutter.formal_name }}.exe')
+# Rename the stub binary we want
+STUB_PATH = (
+ BIN_PATH / '{% if cookiecutter.console_app %}Console{% else %}GUI{% endif %}-Stub-{{ cookiecutter.python_version|py_tag }}.exe'
+)
+STUB_PATH.rename(BIN_PATH / "Stub.exe")
# Delete all remaining stubs
-for stub in BIN_PATH.glob("Stub-*.exe"):
+for stub in BIN_PATH.glob("*-Stub-*.exe"):
os.unlink(stub)
diff --git a/stub/pyproject.toml b/stub/pyproject.toml
index 93e4ec4..9eff850 100644
--- a/stub/pyproject.toml
+++ b/stub/pyproject.toml
@@ -2,8 +2,15 @@
project_name = "Stub"
bundle = "org.beeware"
version = "1.0.0"
+license.file = "../LICENSE"
-[tool.briefcase.app.stub]
-formal_name = "Stub"
-description = "A stub binary that can be integrated into the Windows app template"
-sources = ['src/stub']
+[tool.briefcase.app.gui-stub]
+formal_name = "GUI Stub"
+description = "A stub binary for GUI apps that can be integrated into the Windows app template"
+sources = ['src/gui_stub']
+
+[tool.briefcase.app.console-stub]
+formal_name = "Console Stub"
+description = "A stub binary for console apps that can be integrated into the Windows app template"
+sources = ['src/console_stub']
+console_app = true
diff --git a/stub/src/stub/__init__.py b/stub/src/console_stub/__init__.py
similarity index 100%
rename from stub/src/stub/__init__.py
rename to stub/src/console_stub/__init__.py
diff --git a/stub/src/gui_stub/__init__.py b/stub/src/gui_stub/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/{{ cookiecutter.format }}/src/Console-Stub-3.10.exe b/{{ cookiecutter.format }}/src/Console-Stub-3.10.exe
new file mode 100644
index 0000000..b40ace3
Binary files /dev/null and b/{{ cookiecutter.format }}/src/Console-Stub-3.10.exe differ
diff --git a/{{ cookiecutter.format }}/src/Console-Stub-3.11.exe b/{{ cookiecutter.format }}/src/Console-Stub-3.11.exe
new file mode 100644
index 0000000..3eb7730
Binary files /dev/null and b/{{ cookiecutter.format }}/src/Console-Stub-3.11.exe differ
diff --git a/{{ cookiecutter.format }}/src/Console-Stub-3.12.exe b/{{ cookiecutter.format }}/src/Console-Stub-3.12.exe
new file mode 100644
index 0000000..f84c62c
Binary files /dev/null and b/{{ cookiecutter.format }}/src/Console-Stub-3.12.exe differ
diff --git a/{{ cookiecutter.format }}/src/Console-Stub-3.8.exe b/{{ cookiecutter.format }}/src/Console-Stub-3.8.exe
new file mode 100644
index 0000000..2ca0844
Binary files /dev/null and b/{{ cookiecutter.format }}/src/Console-Stub-3.8.exe differ
diff --git a/{{ cookiecutter.format }}/src/Console-Stub-3.9.exe b/{{ cookiecutter.format }}/src/Console-Stub-3.9.exe
new file mode 100644
index 0000000..a562f98
Binary files /dev/null and b/{{ cookiecutter.format }}/src/Console-Stub-3.9.exe differ
diff --git a/{{ cookiecutter.format }}/src/GUI-Stub-3.10.exe b/{{ cookiecutter.format }}/src/GUI-Stub-3.10.exe
new file mode 100644
index 0000000..9417322
Binary files /dev/null and b/{{ cookiecutter.format }}/src/GUI-Stub-3.10.exe differ
diff --git a/{{ cookiecutter.format }}/src/GUI-Stub-3.11.exe b/{{ cookiecutter.format }}/src/GUI-Stub-3.11.exe
new file mode 100644
index 0000000..5e7fe46
Binary files /dev/null and b/{{ cookiecutter.format }}/src/GUI-Stub-3.11.exe differ
diff --git a/{{ cookiecutter.format }}/src/GUI-Stub-3.12.exe b/{{ cookiecutter.format }}/src/GUI-Stub-3.12.exe
new file mode 100644
index 0000000..ce9cd99
Binary files /dev/null and b/{{ cookiecutter.format }}/src/GUI-Stub-3.12.exe differ
diff --git a/{{ cookiecutter.format }}/src/GUI-Stub-3.8.exe b/{{ cookiecutter.format }}/src/GUI-Stub-3.8.exe
new file mode 100644
index 0000000..875d998
Binary files /dev/null and b/{{ cookiecutter.format }}/src/GUI-Stub-3.8.exe differ
diff --git a/{{ cookiecutter.format }}/src/GUI-Stub-3.9.exe b/{{ cookiecutter.format }}/src/GUI-Stub-3.9.exe
new file mode 100644
index 0000000..94b6ab7
Binary files /dev/null and b/{{ cookiecutter.format }}/src/GUI-Stub-3.9.exe differ
diff --git a/{{ cookiecutter.format }}/src/Stub-3.10.exe b/{{ cookiecutter.format }}/src/Stub-3.10.exe
deleted file mode 100644
index ff4f650..0000000
Binary files a/{{ cookiecutter.format }}/src/Stub-3.10.exe and /dev/null differ
diff --git a/{{ cookiecutter.format }}/src/Stub-3.11.exe b/{{ cookiecutter.format }}/src/Stub-3.11.exe
deleted file mode 100644
index 93a1669..0000000
Binary files a/{{ cookiecutter.format }}/src/Stub-3.11.exe and /dev/null differ
diff --git a/{{ cookiecutter.format }}/src/Stub-3.12.exe b/{{ cookiecutter.format }}/src/Stub-3.12.exe
deleted file mode 100644
index bee5881..0000000
Binary files a/{{ cookiecutter.format }}/src/Stub-3.12.exe and /dev/null differ
diff --git a/{{ cookiecutter.format }}/src/Stub-3.8.exe b/{{ cookiecutter.format }}/src/Stub-3.8.exe
deleted file mode 100644
index 13e62c7..0000000
Binary files a/{{ cookiecutter.format }}/src/Stub-3.8.exe and /dev/null differ
diff --git a/{{ cookiecutter.format }}/src/Stub-3.9.exe b/{{ cookiecutter.format }}/src/Stub-3.9.exe
deleted file mode 100644
index 44b0749..0000000
Binary files a/{{ cookiecutter.format }}/src/Stub-3.9.exe and /dev/null differ
diff --git a/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs b/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs
index a1df62c..536defa 100644
--- a/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs
+++ b/{{ cookiecutter.format }}/{{ cookiecutter.app_name }}.wxs
@@ -63,7 +63,14 @@
{%- endif %}
-
+ {% if cookiecutter.console_app %}
+
+
+
+
+
+
+ {% endif %}