mirror of https://github.com/cirruslabs/tart.git
Embed AppIcon.png within binary (#30)
* Build product explicitly Without it resources are not embedded in the executable * Embed icon in code
This commit is contained in:
parent
f07ffed6c8
commit
4a5efefbc9
|
|
@ -5,8 +5,8 @@ task:
|
|||
labels:
|
||||
os: darwin
|
||||
arch: arm64
|
||||
build_script: swift build
|
||||
sign_script: codesign --sign - --entitlements Sources/tart/tart.entitlements --force .build/debug/tart
|
||||
build_script: swift build --product tart
|
||||
sign_script: codesign --sign - --entitlements Resources/tart.entitlements --force .build/debug/tart
|
||||
binary_artifacts:
|
||||
path: .build/debug/tart
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ before:
|
|||
|
||||
after:
|
||||
hooks:
|
||||
- codesign --sign - --entitlements Sources/tart/tart.entitlements --force .build/arm64-apple-macosx/release/tart
|
||||
- codesign --sign - --entitlements Resources/tart.entitlements --force .build/arm64-apple-macosx/release/tart
|
||||
|
||||
archives:
|
||||
- id: binary
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="sign debug" type="ShConfigurationType">
|
||||
<option name="SCRIPT_TEXT" value="codesign --sign - --entitlements Sources/tart/tart.entitlements --force .build/debug/tart" />
|
||||
<option name="SCRIPT_TEXT" value="codesign --sign - --entitlements Resources/tart.entitlements --force .build/debug/tart" />
|
||||
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
|
||||
<option name="SCRIPT_PATH" value="$PROJECT_DIR$/scripts/sign.sh" />
|
||||
<option name="SCRIPT_OPTIONS" value="" />
|
||||
|
|
@ -14,4 +14,4 @@
|
|||
<envs />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
</component>
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ let package = Package(
|
|||
.executableTarget(name: "tart",
|
||||
dependencies: [
|
||||
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
||||
],
|
||||
resources: [
|
||||
.process("Resources/AppIcon.png")
|
||||
]),
|
||||
]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@ struct Run: AsyncParsableCommand {
|
|||
nsApp.setActivationPolicy(.regular)
|
||||
nsApp.activate(ignoringOtherApps: true)
|
||||
|
||||
let icon = Bundle.module.image(forResource: "AppIcon.png")
|
||||
nsApp.applicationIconImage = icon
|
||||
nsApp.applicationIconImage = NSImage(data: AppIconData)
|
||||
|
||||
struct MainApp: App {
|
||||
var body: some Scene {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue