livebook/app_builder/lib/app_builder.ex

38 lines
782 B
Elixir
Raw Normal View History

2022-01-18 00:34:38 +08:00
defmodule AppBuilder do
def bundle(release) do
os = os()
2022-01-18 00:34:38 +08:00
allowed_options = [
:name,
:server,
icon_path: [
macos: Application.app_dir(:wx, "examples/demo/erlang.png")
],
url_schemes: [],
document_types: [],
additional_paths: [],
macos_is_agent_app: false,
macos_build_dmg: false,
macos_notarization: nil,
windows_build_installer: true
]
options = Keyword.validate!(release.options[:app], allowed_options)
case os do
:macos ->
AppBuilder.MacOS.bundle(release, options)
:windows ->
AppBuilder.Windows.bundle(release, options)
end
end
2022-05-27 20:45:20 +08:00
def os do
case :os.type() do
{:unix, :darwin} -> :macos
{:win32, _} -> :windows
end
end
2022-01-18 00:34:38 +08:00
end