Skip to content

Commit

Permalink
Add back Info.plist and use it for version in swift package
Browse files Browse the repository at this point in the history
  • Loading branch information
kcrawford committed Dec 29, 2023
1 parent 805e288 commit 9e35ce9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ let package = Package(
name: "DockUtil",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
linkerSettings: [
.unsafeFlags([
"-Xlinker", "-sectcreate",
"-Xlinker", "__TEXT",
"-Xlinker", "__info_plist",
"-Xlinker", "Sources/Resources/Info.plist"
])
]
),
.testTarget(
Expand Down
2 changes: 1 addition & 1 deletion Sources/DockUtil/DockUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import ArgumentParser
import Darwin

let VERSION = "3.0.2"
let VERSION = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
var gv = 0 // Global verbosity

struct DockAdditionOptions {
Expand Down
16 changes: 16 additions & 0 deletions Sources/Resources/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>dockutil.cli.tool</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>dockutil</string>
<key>CFBundleShortVersionString</key>
<string>3.0.3</string>
<key>CFBundleVersion</key>
<string>3.0.3</string>
</dict>
</plist>

0 comments on commit 9e35ce9

Please sign in to comment.