How to use the briefcase.platforms.macOS.app.macOSAppCreateCommand function in briefcase

To help you get started, we’ve selected a few briefcase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beeware / briefcase / tests / test_cmdline.py View on Github external
def test_bare_command(monkeypatch):
    "``briefcase create`` returns the macOS create app command"
    # Pretend we're on macOS, regardless of where the tests run.
    monkeypatch.setattr(sys, 'platform', 'darwin')

    cmd, options = parse_cmdline('create'.split())

    assert isinstance(cmd, macOSAppCreateCommand)
    assert cmd.platform == 'macOS'
    assert cmd.output_format == 'dmg'
    assert options == {'verbosity': 1}
github beeware / briefcase / tests / test_cmdline.py View on Github external
def test_command_explicit_platform_case_handling(monkeypatch):
    "``briefcase create macOS`` returns macOS create app command"
    # Pretend we're on macOS, regardless of where the tests run.
    monkeypatch.setattr(sys, 'platform', 'darwin')

    # This is all lower case; the command normalizes to macOS
    cmd, options = parse_cmdline('create macOS'.split())

    assert isinstance(cmd, macOSAppCreateCommand)
    assert cmd.platform == 'macOS'
    assert cmd.output_format == 'dmg'
    assert options == {'verbosity': 1}
github beeware / briefcase / tests / platforms / macOS / app / test_mixin.py View on Github external
def test_distribution_path(first_app_config, tmp_path):
    command = macOSAppCreateCommand(base_path=tmp_path)
    distribution_path = command.distribution_path(first_app_config)

    assert distribution_path == tmp_path / 'macOS' / 'First App' / 'First App.app'
github beeware / briefcase / tests / platforms / macOS / app / test_mixin.py View on Github external
def test_binary_path(first_app_config, tmp_path):
    command = macOSAppCreateCommand(base_path=tmp_path)
    binary_path = command.binary_path(first_app_config)

    assert binary_path == tmp_path / 'macOS' / 'First App' / 'First App.app'
github beeware / briefcase / src / briefcase / platforms / macOS / dmg.py View on Github external
class macOSDmgMixin(macOSAppMixin):
    output_format = 'dmg'

    def distribution_path(self, app):
        return self.platform_path / '{app.formal_name}-{app.version}.dmg'.format(app=app)

    def verify_tools(self):
        super().verify_tools()
        if dmgbuild is None:
            raise BriefcaseCommandError("""
A macOS DMG can only be created on macOS.
""")


class macOSDmgCreateCommand(macOSDmgMixin, macOSAppCreateCommand):
    description = "Create and populate a macOS DMG."

    @property
    def app_template_url(self):
        "The URL for a cookiecutter repository to use when creating apps"
        return 'https://github.com/beeware/briefcase-{self.platform}-app-template.git'.format(
            self=self
        )


class macOSDmgUpdateCommand(macOSDmgMixin, macOSAppUpdateCommand):
    description = "Update an existing macOS DMG."


class macOSDmgBuildCommand(macOSDmgMixin, macOSAppBuildCommand):
    description = "Build a macOS DMG."