Skip to content

Commit 1c2de38

Browse files
committed
[CPP-59] Add Info.plist to app on Mac
Currently it only describes the icon for the app.
1 parent 016c06b commit 1c2de38

File tree

7 files changed

+20
-2
lines changed

7 files changed

+20
-2
lines changed

Makefile.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ conda run -n $CONDA_ENV python utils/create_nuitka_script.py
163163
dependencies = ["prod-nuitka-build"]
164164
script_runner = "@shell"
165165
script = '''
166-
mkdir -p main.app/Contents/MacOS
167-
cp -r main.dist/* main.app/Contents/MacOS/.
166+
mkdir -p main.app/Contents/MacOS main.app/Contents/Resources
167+
cp -r main.dist/* main.app/Contents/MacOS/
168+
iconutil --convert icns src/main/icons/Mac.iconset
169+
mv src/main/icons/Mac.icns main.app/Contents/Resources/SwiftNavConsole.icns
170+
conda run -n $CONDA_ENV python src/build/generate-mac-info-plist.py
168171
hdiutil create -volname SwiftNavConsole -srcfolder main.app -ov -format UDZO 'swift_navigation_console.dmg'
169172
'''
170173

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os.path
2+
3+
import plistlib
4+
5+
6+
def create_main_plist(app_path):
7+
data = {
8+
"CFBundleIconFile": "SwiftNavConsole.icns",
9+
}
10+
plist_path = os.path.join(app_path, "Contents", "Info.plist")
11+
with open(plist_path, "wb") as fp:
12+
plistlib.dump(data, fp)
13+
14+
15+
create_main_plist("main.app")
6 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)