Skip to content

Commit 34e20df

Browse files
committed
v1.8.2 - native Apple Silicon build & universal binary
- Build natively on Apple Silicon (M1-M4) without Rosetta and ship a universal x86_64+arm64 binary so the same .app/.dmg runs on Intel too. - Package.swift: drop the missing MPCServer target so SwiftPM resolves. - Views: gate #Preview blocks behind XCODE_PREVIEWS so swift build (CLI) no longer fails on the missing PreviewsMacros plugin. Pass -D XCODE_PREVIEWS in Xcode to keep previews available. - PersistenceGraph: qualify cos/sin as Darwin.cos/Darwin.sin to resolve ambiguity with SwiftUI overloads. - build.sh: build arm64 + x86_64 separately and lipo them; UNIVERSAL=0 to opt out and build host-only. - README: bump download link to v1.8.2.
1 parent 70d8577 commit 34e20df

20 files changed

Lines changed: 54 additions & 15 deletions

MacPersistenceChecker/Models/PersistenceGraph.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ class PersistenceGraph: ObservableObject {
225225
for (index, _) in nodes.enumerated() {
226226
let angle = (2 * .pi * Double(index)) / Double(nodes.count)
227227
nodes[index].position = CGPoint(
228-
x: centerX + radius * cos(angle),
229-
y: centerY + radius * sin(angle)
228+
x: centerX + radius * Darwin.cos(angle),
229+
y: centerY + radius * Darwin.sin(angle)
230230
)
231231
}
232232

MacPersistenceChecker/Views/Categories/CategoryListView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,9 @@ struct MITREBadge: View {
367367
}
368368
}
369369

370+
#if XCODE_PREVIEWS
370371
#Preview {
371372
CategoryListView()
372373
.environmentObject(AppState.shared)
373374
}
375+
#endif

MacPersistenceChecker/Views/Charts/CategoryBreakdownChartView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ struct CategorySparklineView: View {
146146
}
147147
}
148148

149+
#if XCODE_PREVIEWS
149150
#Preview {
150151
CategoryBreakdownChartView(items: [])
151152
.frame(width: 300)
152153
.padding()
153154
}
155+
#endif

MacPersistenceChecker/Views/Charts/NodeChartView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,10 +455,12 @@ struct StatRow: View {
455455

456456
// MARK: - Preview
457457

458+
#if XCODE_PREVIEWS
458459
#Preview {
459460
VStack {
460461
Text("Node Chart Preview")
461462
}
462463
.frame(width: 400, height: 200)
463464
.padding()
464465
}
466+
#endif

MacPersistenceChecker/Views/Charts/RiskDistributionChartView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,10 @@ struct RiskGaugeView: View {
167167
}
168168
}
169169

170+
#if XCODE_PREVIEWS
170171
#Preview {
171172
RiskDistributionChartView(items: [])
172173
.frame(width: 250)
173174
.padding()
174175
}
176+
#endif

MacPersistenceChecker/Views/Charts/SecurityProfileChartView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ private func polygonPoints(center: CGPoint, radius: CGFloat, sides: Int) -> [CGP
524524

525525
// MARK: - Preview
526526

527+
#if XCODE_PREVIEWS
527528
#Preview {
528529
// Preview with empty state
529530
VStack {
@@ -535,3 +536,4 @@ private func polygonPoints(center: CGPoint, radius: CGFloat, sides: Int) -> [CGP
535536
.frame(width: 500, height: 400)
536537
.padding()
537538
}
539+
#endif

MacPersistenceChecker/Views/Charts/StatsDashboardView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,10 @@ struct SidebarChartsSection: View {
226226
}
227227
}
228228

229+
#if XCODE_PREVIEWS
229230
#Preview {
230231
StatsDashboardView()
231232
.environmentObject(AppState.shared)
232233
.frame(width: 800, height: 600)
233234
}
235+
#endif

MacPersistenceChecker/Views/Charts/TrustLevelChartView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ struct EmptyChartPlaceholder: View {
222222
}
223223
}
224224

225+
#if XCODE_PREVIEWS
225226
#Preview {
226227
TrustLevelChartView(items: [])
227228
.frame(width: 220)
228229
.padding()
229230
}
231+
#endif

MacPersistenceChecker/Views/Detail/ItemDetailView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,9 @@ struct AgeAnomalyRow: View {
20732073
}
20742074
}
20752075

2076+
#if XCODE_PREVIEWS
20762077
#Preview {
20772078
ItemDetailView()
20782079
.environmentObject(AppState.shared)
20792080
}
2081+
#endif

MacPersistenceChecker/Views/Graph/GraphDetailWindow.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,10 @@ struct RiskScoreBar: View {
786786

787787
// MARK: - Preview
788788

789+
#if XCODE_PREVIEWS
789790
#Preview {
790791
GraphDetailWindowView()
791792
.environmentObject(AppState.shared)
792793
.frame(width: 900, height: 700)
793794
}
795+
#endif

0 commit comments

Comments
 (0)