Run Mac app in the background (#1199)

This commit is contained in:
Wojtek Mach 2022-05-20 14:27:04 +02:00 committed by GitHub
parent cf587e7115
commit 5af5c75108
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -98,7 +98,8 @@ defmodule AppBuilder.MacOS do
:info_plist, :info_plist,
:url_schemes, :url_schemes,
:document_types, :document_types,
:additional_paths :additional_paths,
:is_agent_app
]) ])
app_name = Keyword.fetch!(options, :name) app_name = Keyword.fetch!(options, :name)
@ -301,6 +302,10 @@ defmodule AppBuilder.MacOS do
</array> </array>
<% end %> <% end %>
<%= if options[:is_agent_app] do %>
<key>LSUIElement</key>
<true/>
<% end %>
</dict> </dict>
</plist> </plist>
""" """

View file

@ -192,12 +192,18 @@ defmodule Livebook.MixProject do
] ]
defp build_mac_app(release) do defp build_mac_app(release) do
AppBuilder.build_mac_app(release, @app_options) options =
[
is_agent_app: true
] ++ @app_options
AppBuilder.build_mac_app(release, options)
end end
defp build_mac_app_dmg(release) do defp build_mac_app_dmg(release) do
options = options =
[ [
is_agent_app: true,
codesign: [ codesign: [
identity: System.fetch_env!("CODESIGN_IDENTITY") identity: System.fetch_env!("CODESIGN_IDENTITY")
], ],