Files
OpenStats/Makefile
T
gentpan dc5c987b96 菜单栏风格、面板浅色与深色主题,修复面板打不开
- 菜单栏八种风格整体套用、可按指标单独指定,网速三种样式,悬停显示完整读数,字号缩小并统一
- 面板浅色、深色实色主题与一键切换,液态玻璃改为可选
- 修复关闭液态玻璃后面板内容尺寸翻倍导致看起来打不开,首次打开时高度偏小
- Developer ID 自动签名,辅助工具按自身签名团队校验调用方,新增发布脚本
- 更新日志、README、截图同步
2026-09-13 04:09:02 +05:00

61 lines
2.1 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
PROJECT := OpenStats.xcodeproj
SCHEME := OpenStats
CONFIG ?= Debug
DERIVED := build/DerivedData
APP := $(DERIVED)/Build/Products/$(CONFIG)/OpenStats.app
# 与 QuotaBar 相同:钥匙串里有 Developer ID 证书就自动用它签名,否则退回 ad-hoc(仅限本机)。
# 也可以用 SIGN_ID="..." 显式指定。
SIGN_ID ?= $(shell security find-identity -v -p codesigning 2>/dev/null | grep 'Developer ID Application' | head -1 | sed -E 's/.*"(.*)".*/\1/')
TEAM_ID := $(shell echo '$(SIGN_ID)' | sed -nE 's/.*\(([A-Z0-9]+)\)$$/\1/p')
ifneq ($(strip $(TEAM_ID)),)
# Release 加安全时间戳,公证要求如此,证书过期后签名依然有效
SIGN_FLAGS := CODE_SIGN_IDENTITY="$(SIGN_ID)" DEVELOPMENT_TEAM=$(TEAM_ID) \
$(if $(filter Release,$(CONFIG)),OTHER_CODE_SIGN_FLAGS=--timestamp CODE_SIGN_INJECT_BASE_ENTITLEMENTS=NO)
endif
.PHONY: generate build run install release stop test snapshot open clean
## 由 project.yml 生成 Xcode 工程
generate:
xcodegen generate --quiet
## 编译 App(含辅助工具)
build: generate
xcodebuild -project $(PROJECT) -scheme $(SCHEME) -configuration $(CONFIG) \
-derivedDataPath $(DERIVED) -destination 'platform=macOS' -quiet $(SIGN_FLAGS) build
## 编译并启动(会先结束正在运行的 OpenStats)
run: build stop
open $(APP)
## 以 Release 构建安装到 /Applications 并启动(覆盖旧版本,保留偏好设置)
install:
$(MAKE) build CONFIG=Release
-pkill -x OpenStats
rm -rf /Applications/OpenStats.app
ditto $(DERIVED)/Build/Products/Release/OpenStats.app /Applications/OpenStats.app
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/OpenStats.app
open /Applications/OpenStats.app
## 发布:签名、公证、装订、打包 DMG,生成 Homebrew cask(见 Scripts/release.sh)
release:
./Scripts/release.sh
stop:
-pkill -x OpenStats
## 单元测试
test:
cd Packages/OpenStatsKit && swift test
## 用本机实时数据渲染各页面截图到 build/snapshots
snapshot: build
$(APP)/Contents/MacOS/OpenStats --snapshot build/snapshots
open: generate
open $(PROJECT)
clean:
rm -rf build