Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/2489.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed issue with app icon when building for Windows.
17 changes: 17 additions & 0 deletions src/briefcase/platforms/windows/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ def verify_tools(self):
with suppress(BriefcaseCommandError):
WindowsSDK.verify(tools=self.tools)

def finalize_app_config(self, app: BaseConfig):
"""If an app has a long description, issue a warning."""
if len(app.description) > 80:
self.console.warning(
"""\
*************************************************************************
** WARNING: Long App description! **
*************************************************************************

your app has a description that is longer than 80 characters.
While this is supported, longer descriptions may be truncated
when displayed in some parts of the Windows UI.

*************************************************************************
"""
)

def build_app(self, app: BaseConfig, **kwargs):
"""Build the application.

Expand Down
17 changes: 17 additions & 0 deletions src/briefcase/platforms/windows/visualstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ def verify_tools(self):
super().verify_tools()
VisualStudio.verify(tools=self.tools)

def finalize_app_config(self, app: BaseConfig):
"""If an app has a long description, issue a warning."""
if len(app.description) > 80:
self.console.warning(
"""\
*************************************************************************
** WARNING: Long App description! **
*************************************************************************

your app has a description that is longer than 80 characters.
While this is supported, longer descriptions may be truncated
when displayed in some parts of the Windows UI.

*************************************************************************
"""
)

def build_app(self, app: BaseConfig, **kwargs):
"""Build the Visual Studio project.

Expand Down
18 changes: 18 additions & 0 deletions tests/platforms/windows/app/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,24 @@ def test_verify_with_windows_sdk(build_command, windows_sdk, monkeypatch):
assert isinstance(build_command.tools.windows_sdk, WindowsSDK)


def test_long_description_warning(build_command, first_app_templated, capsys):
"""A warning is displayed if an app has a description longer than 80 chars."""
first_app_templated.description = "This is a very long description that exceeds the 80 character limit and it should trigger a warning."
build_command.finalize_app_config(first_app_templated)
output = capsys.readouterr().out
assert "your app has a description that is longer than 80 characters." in output


def test_short_description_no_warning(build_command, first_app_templated, capsys):
"""No warning displayed if the app description is 80 chars or less."""
first_app_templated.description = (
"This is a short description that will not trigger any warnings."
)
build_command.finalize_app_config(first_app_templated)
output = capsys.readouterr().out
assert "your app has a description that is longer than 80 characters." not in output


@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
@pytest.mark.parametrize("pre_existing", [True, False])
@pytest.mark.parametrize("console_app", [True, False])
Expand Down
18 changes: 18 additions & 0 deletions tests/platforms/windows/visualstudio/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ def test_verify(build_command, monkeypatch):
assert isinstance(build_command.tools.visualstudio, VisualStudio)


def test_long_description_warning(build_command, first_app_config, capsys):
"""A warning is displayed if an app has a description longer than 80 chars."""
first_app_config.description = "This is a very long description that exceeds the 80 character limit. It will trigger a warning message in the Windows Visual Studio build process. This description is definitely too long."
build_command.finalize_app_config(first_app_config)
output = capsys.readouterr().out
assert "your app has a description that is longer than 80 characters" in output


def test_short_description_no_warning(build_command, first_app_config, capsys):
"""No warning is displayed if the app description is 80 chars or less."""
first_app_config.description = (
"This is a short description that will not trigger any warnings."
)
build_command.finalize_app_config(first_app_config)
output = capsys.readouterr().out
assert "WARNING: Long App description!" not in output


@pytest.mark.parametrize("tool_debug_mode", (True, False))
def test_build_app(build_command, first_app_config, tool_debug_mode, tmp_path):
"""The solution will be compiled when the project is built."""
Expand Down