Skip to content

Commit 187681f

Browse files
committed
async parse with progress indicator
1 parent 7d90f3b commit 187681f

File tree

11 files changed

+1457
-129
lines changed

11 files changed

+1457
-129
lines changed

LinkMapInspector.xcodeproj/project.pbxproj

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,10 @@
108108
F25B998C294B7E99006DE7A3 /* LinkMapInspector */ = {
109109
isa = PBXGroup;
110110
children = (
111-
F25B99BB294B7EA9006DE7A3 /* LinkMapParser.swift */,
111+
F2CD69052AF538A100D60D05 /* View */,
112+
F2CD69022AF531FB00D60D05 /* View Model */,
113+
F2CD69012AF531F200D60D05 /* Model */,
112114
F25B998D294B7E99006DE7A3 /* AppDelegate.swift */,
113-
F25B998F294B7E99006DE7A3 /* ViewController.swift */,
114-
F25B99C1294CD519006DE7A3 /* Node.swift */,
115-
F25B9991294B7E99006DE7A3 /* Document.swift */,
116115
F25B9993294B7E9C006DE7A3 /* Assets.xcassets */,
117116
F25B9995294B7E9C006DE7A3 /* Main.storyboard */,
118117
F25B9998294B7E9C006DE7A3 /* Info.plist */,
@@ -124,9 +123,9 @@
124123
F25B99A1294B7E9C006DE7A3 /* LinkMapInspectorTests */ = {
125124
isa = PBXGroup;
126125
children = (
126+
F25B99A2294B7E9C006DE7A3 /* LinkMapInspectorTests.swift */,
127127
F25B99BF294B824B006DE7A3 /* LinkMapViewer-LinkMap-normal-x86_64.txt */,
128128
F25B99BD294B823E006DE7A3 /* LinkMapViewerTests.swift */,
129-
F25B99A2294B7E9C006DE7A3 /* LinkMapInspectorTests.swift */,
130129
F25B99C3294CE0E7006DE7A3 /* NodeTests.swift */,
131130
);
132131
path = LinkMapInspectorTests;
@@ -141,6 +140,31 @@
141140
path = LinkMapInspectorUITests;
142141
sourceTree = "<group>";
143142
};
143+
F2CD69012AF531F200D60D05 /* Model */ = {
144+
isa = PBXGroup;
145+
children = (
146+
F25B99BB294B7EA9006DE7A3 /* LinkMapParser.swift */,
147+
);
148+
path = Model;
149+
sourceTree = "<group>";
150+
};
151+
F2CD69022AF531FB00D60D05 /* View Model */ = {
152+
isa = PBXGroup;
153+
children = (
154+
F25B9991294B7E99006DE7A3 /* Document.swift */,
155+
F25B99C1294CD519006DE7A3 /* Node.swift */,
156+
);
157+
path = "View Model";
158+
sourceTree = "<group>";
159+
};
160+
F2CD69052AF538A100D60D05 /* View */ = {
161+
isa = PBXGroup;
162+
children = (
163+
F25B998F294B7E99006DE7A3 /* ViewController.swift */,
164+
);
165+
path = View;
166+
sourceTree = "<group>";
167+
};
144168
/* End PBXGroup section */
145169

146170
/* Begin PBXNativeTarget section */
@@ -205,7 +229,7 @@
205229
attributes = {
206230
BuildIndependentTargetsInParallel = 1;
207231
LastSwiftUpdateCheck = 1410;
208-
LastUpgradeCheck = 1410;
232+
LastUpgradeCheck = 1500;
209233
TargetAttributes = {
210234
F25B9989294B7E99006DE7A3 = {
211235
CreatedOnToolsVersion = 14.1;
@@ -359,9 +383,11 @@
359383
CLANG_WARN_UNREACHABLE_CODE = YES;
360384
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
361385
COPY_PHASE_STRIP = NO;
386+
DEAD_CODE_STRIPPING = YES;
362387
DEBUG_INFORMATION_FORMAT = dwarf;
363388
ENABLE_STRICT_OBJC_MSGSEND = YES;
364389
ENABLE_TESTABILITY = YES;
390+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
365391
GCC_C_LANGUAGE_STANDARD = gnu11;
366392
GCC_DYNAMIC_NO_PIC = NO;
367393
GCC_NO_COMMON_BLOCKS = YES;
@@ -419,9 +445,11 @@
419445
CLANG_WARN_UNREACHABLE_CODE = YES;
420446
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
421447
COPY_PHASE_STRIP = NO;
448+
DEAD_CODE_STRIPPING = YES;
422449
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
423450
ENABLE_NS_ASSERTIONS = NO;
424451
ENABLE_STRICT_OBJC_MSGSEND = YES;
452+
ENABLE_USER_SCRIPT_SANDBOXING = YES;
425453
GCC_C_LANGUAGE_STANDARD = gnu11;
426454
GCC_NO_COMMON_BLOCKS = YES;
427455
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -448,6 +476,7 @@
448476
CODE_SIGN_STYLE = Automatic;
449477
COMBINE_HIDPI_IMAGES = YES;
450478
CURRENT_PROJECT_VERSION = 1;
479+
DEAD_CODE_STRIPPING = YES;
451480
DEVELOPMENT_TEAM = Y5CFB9JHGU;
452481
ENABLE_HARDENED_RUNTIME = YES;
453482
GENERATE_INFOPLIST_FILE = YES;
@@ -476,6 +505,7 @@
476505
CODE_SIGN_STYLE = Automatic;
477506
COMBINE_HIDPI_IMAGES = YES;
478507
CURRENT_PROJECT_VERSION = 1;
508+
DEAD_CODE_STRIPPING = YES;
479509
DEVELOPMENT_TEAM = Y5CFB9JHGU;
480510
ENABLE_HARDENED_RUNTIME = YES;
481511
GENERATE_INFOPLIST_FILE = YES;
@@ -502,6 +532,7 @@
502532
BUNDLE_LOADER = "$(TEST_HOST)";
503533
CODE_SIGN_STYLE = Automatic;
504534
CURRENT_PROJECT_VERSION = 1;
535+
DEAD_CODE_STRIPPING = YES;
505536
DEVELOPMENT_TEAM = Y5CFB9JHGU;
506537
GENERATE_INFOPLIST_FILE = YES;
507538
MACOSX_DEPLOYMENT_TARGET = 13.0;
@@ -521,6 +552,7 @@
521552
BUNDLE_LOADER = "$(TEST_HOST)";
522553
CODE_SIGN_STYLE = Automatic;
523554
CURRENT_PROJECT_VERSION = 1;
555+
DEAD_CODE_STRIPPING = YES;
524556
DEVELOPMENT_TEAM = Y5CFB9JHGU;
525557
GENERATE_INFOPLIST_FILE = YES;
526558
MACOSX_DEPLOYMENT_TARGET = 13.0;
@@ -539,6 +571,7 @@
539571
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
540572
CODE_SIGN_STYLE = Automatic;
541573
CURRENT_PROJECT_VERSION = 1;
574+
DEAD_CODE_STRIPPING = YES;
542575
DEVELOPMENT_TEAM = Y5CFB9JHGU;
543576
GENERATE_INFOPLIST_FILE = YES;
544577
MARKETING_VERSION = 1.0;
@@ -556,6 +589,7 @@
556589
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
557590
CODE_SIGN_STYLE = Automatic;
558591
CURRENT_PROJECT_VERSION = 1;
592+
DEAD_CODE_STRIPPING = YES;
559593
DEVELOPMENT_TEAM = Y5CFB9JHGU;
560594
GENERATE_INFOPLIST_FILE = YES;
561595
MARKETING_VERSION = 1.0;
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1500"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "F25B9989294B7E99006DE7A3"
18+
BuildableName = "LinkMapInspector.app"
19+
BlueprintName = "LinkMapInspector"
20+
ReferencedContainer = "container:LinkMapInspector.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
shouldAutocreateTestPlan = "YES">
31+
<Testables>
32+
<TestableReference
33+
skipped = "NO"
34+
parallelizable = "YES">
35+
<BuildableReference
36+
BuildableIdentifier = "primary"
37+
BlueprintIdentifier = "F25B999D294B7E9C006DE7A3"
38+
BuildableName = "LinkMapInspectorTests.xctest"
39+
BlueprintName = "LinkMapInspectorTests"
40+
ReferencedContainer = "container:LinkMapInspector.xcodeproj">
41+
</BuildableReference>
42+
</TestableReference>
43+
<TestableReference
44+
skipped = "NO"
45+
parallelizable = "YES">
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "F25B99A7294B7E9C006DE7A3"
49+
BuildableName = "LinkMapInspectorUITests.xctest"
50+
BlueprintName = "LinkMapInspectorUITests"
51+
ReferencedContainer = "container:LinkMapInspector.xcodeproj">
52+
</BuildableReference>
53+
</TestableReference>
54+
</Testables>
55+
</TestAction>
56+
<LaunchAction
57+
buildConfiguration = "Debug"
58+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
59+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60+
launchStyle = "0"
61+
useCustomWorkingDirectory = "NO"
62+
ignoresPersistentStateOnLaunch = "NO"
63+
debugDocumentVersioning = "YES"
64+
debugServiceExtension = "internal"
65+
allowLocationSimulation = "YES">
66+
<BuildableProductRunnable
67+
runnableDebuggingMode = "0">
68+
<BuildableReference
69+
BuildableIdentifier = "primary"
70+
BlueprintIdentifier = "F25B9989294B7E99006DE7A3"
71+
BuildableName = "LinkMapInspector.app"
72+
BlueprintName = "LinkMapInspector"
73+
ReferencedContainer = "container:LinkMapInspector.xcodeproj">
74+
</BuildableReference>
75+
</BuildableProductRunnable>
76+
<AdditionalOptions>
77+
<AdditionalOption
78+
key = "MallocStackLogging"
79+
value = ""
80+
isEnabled = "YES">
81+
</AdditionalOption>
82+
<AdditionalOption
83+
key = "PrefersMallocStackLoggingLite"
84+
value = ""
85+
isEnabled = "YES">
86+
</AdditionalOption>
87+
</AdditionalOptions>
88+
</LaunchAction>
89+
<ProfileAction
90+
buildConfiguration = "Release"
91+
shouldUseLaunchSchemeArgsEnv = "YES"
92+
savedToolIdentifier = ""
93+
useCustomWorkingDirectory = "NO"
94+
debugDocumentVersioning = "YES">
95+
<BuildableProductRunnable
96+
runnableDebuggingMode = "0">
97+
<BuildableReference
98+
BuildableIdentifier = "primary"
99+
BlueprintIdentifier = "F25B9989294B7E99006DE7A3"
100+
BuildableName = "LinkMapInspector.app"
101+
BlueprintName = "LinkMapInspector"
102+
ReferencedContainer = "container:LinkMapInspector.xcodeproj">
103+
</BuildableReference>
104+
</BuildableProductRunnable>
105+
</ProfileAction>
106+
<AnalyzeAction
107+
buildConfiguration = "Debug">
108+
</AnalyzeAction>
109+
<ArchiveAction
110+
buildConfiguration = "Release"
111+
revealArchiveInOrganizer = "YES">
112+
</ArchiveAction>
113+
</Scheme>

LinkMapInspector/AppDelegate.swift

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,19 @@ import Cocoa
99

1010
@main
1111
class AppDelegate: NSObject, NSApplicationDelegate {
12-
13-
12+
var welcomeWindowController : NSWindowController? = {
13+
let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: nil)
14+
return storyboard.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("welcome-window-controller")) as? NSWindowController
15+
}()
1416

1517
func applicationDidFinishLaunching(_ aNotification: Notification) {
16-
// Insert code here to initialize your application
18+
19+
}
20+
21+
func applicationDidBecomeActive(_ notification: Notification) {
22+
if NSDocumentController.shared.documents.isEmpty {
23+
showWelcome()
24+
}
1725
}
1826

1927
func applicationWillTerminate(_ aNotification: Notification) {
@@ -23,7 +31,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
2331
func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
2432
return true
2533
}
26-
27-
34+
35+
func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
36+
return false;
37+
}
38+
39+
func showWelcome() {
40+
self.welcomeWindowController?.showWindow(self)
41+
}
2842
}
2943

0 commit comments

Comments
 (0)