Skip to content

Commit

Permalink
✨ New file: Makefile!
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Aug 19, 2023
1 parent 46a315a commit 4378403
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Loop.app
project.xcworkspace
xcuserdata
Loop.zip
Build/
2 changes: 1 addition & 1 deletion Loop/LoopApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import WindowManagement

@main
struct LoopApp: App {

@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
let aboutViewController = AboutViewController()

var body: some Scene {
Settings {
SettingsView()
}
.registerSettingsWindow()
.enableOpenWindow()
.commands {
CommandGroup(replacing: CommandGroupPlacement.appInfo) {
Expand Down
5 changes: 2 additions & 3 deletions Loop/Status Item/StatusItemController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import SwiftUI
import WindowManagement

class StatusItemController {

private let aboutViewController = AboutViewController()
private var statusItem: NSStatusItem!

Expand Down Expand Up @@ -38,7 +37,7 @@ class StatusItemController {
} else {
NSApp.activate(ignoringOtherApps: true)
}
for window in NSApp.windows where window.hasShadow == true && window.isMovableByWindowBackground == false {
for window in NSApp.windows where window.title != "About \(Bundle.main.appName)" {
window.orderFrontRegardless()
}
}
Expand All @@ -51,7 +50,7 @@ class StatusItemController {
} else {
NSApp.activate(ignoringOtherApps: true)
}
for window in NSApp.windows where window.hasShadow == true && window.isMovableByWindowBackground == true {
for window in NSApp.windows where window.title == "About \(Bundle.main.appName)" {
window.orderFrontRegardless()
}
}
Expand Down
29 changes: 29 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
macos-release:
rm -r ./Build/
set -o pipefail && xcodebuild archive \
-project ./Loop.xcodeproj \
-destination "generic/platform=macOS" \
-scheme "Loop" \
-archivePath "./Build/Loop.xcarchive" \
-xcconfig "./Loop/Config.xcconfig" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGN_IDENTITY= \
CODE_SIGN_ENTITLEMENTS= \
GCC_OPTIMIZATION_LEVEL=s \
SWIFT_OPTIMIZATION_LEVEL=-O \
GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
DEBUG_INFORMATION_FORMAT=dwarf-with-dsym | xcbeautify
create-dmg \
--volname "Loop" \
--background "./assets/graphics/dmg-background.png" \
--window-pos 200 120 \
--window-size 660 400 \
--icon-size 160 \
--icon "Loop.app" 180 170 \
--hide-extension "Loop.app" \
--app-drop-link 480 170 \
--no-internet-enable \
"./Build/Loop.dmg" \
"./Build/Loop.xcarchive/Products/Applications/"
cp -R ./Build/Loop.xcarchive/Products/Applications/ ./Build/

0 comments on commit 4378403

Please sign in to comment.