livebook/app_builder/lib/app_builder.ex
Wojtek Mach fc7328703a
App bundling improvements (#1211)
1. Replace `mix release mac_app|mac_app_dmg|windows_installer` with a single `mix release app`
2. Extract templates (Launcher.swift, Launcher.vbs, etc) into separate
   files in app_builder/lib/templates
3. Don't verify vc_redist.x64.exe checksum as the Microsoft publishes
   new releases on the same URL
2022-06-01 22:29:54 +02:00

37 lines
782 B
Elixir

defmodule AppBuilder do
def bundle(release) do
os = os()
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
def os do
case :os.type() do
{:unix, :darwin} -> :macos
{:win32, _} -> :windows
end
end
end