Skip to content

Commit cd58866

Browse files
Support dragging project file to app icon to start extraction
- Add Xcode project document type to Info.plist - Move defaults registration to -applicationWillFinishLaunching: - Implement application:openURLs: to handle dragged URLs - Only the first URL is processed - Handling a single project file is the expected common case - Resolves #58
1 parent 86274b3 commit cd58866

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

BuildSettingExtractor/AppDelegate.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,13 @@ - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
240240
return YES;
241241
}
242242

243-
- (void)applicationDidFinishLaunching:(NSNotification *)notification {
243+
- (void)applicationWillFinishLaunching:(NSNotification *)notification {
244244
[[NSUserDefaults standardUserDefaults] tps_registerApplicationDefaults];
245245
}
246246

247+
- (void)application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)urls {
248+
NSURL *fileURL = urls.firstObject;
249+
if (fileURL) { [self processXcodeProjectAtURL:fileURL]; }
250+
}
247251

248252
@end

BuildSettingExtractor/BuildSettingExtractor-Info.plist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
66
<string>en</string>
7+
<key>CFBundleDocumentTypes</key>
8+
<array>
9+
<dict>
10+
<key>CFBundleTypeExtensions</key>
11+
<array>
12+
<string>xcodeproj</string>
13+
</array>
14+
<key>CFBundleTypeRole</key>
15+
<string>Editor</string>
16+
<key>LSItemContentTypes</key>
17+
<array>
18+
<string>com.apple.xcode.project</string>
19+
</array>
20+
</dict>
21+
</array>
722
<key>CFBundleExecutable</key>
823
<string>${EXECUTABLE_NAME}</string>
924
<key>CFBundleIconFile</key>

0 commit comments

Comments
 (0)