Skip to content

Commit a1b263a

Browse files
committed
Swift 2 migration tool updates
1 parent db84c8e commit a1b263a

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

MongoDB.xcodeproj/project.pbxproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,9 @@
277277
7D25A7DA1A697586007EC13C /* Project object */ = {
278278
isa = PBXProject;
279279
attributes = {
280-
LastUpgradeCheck = 0610;
280+
LastSwiftMigration = 0700;
281+
LastSwiftUpdateCheck = 0700;
282+
LastUpgradeCheck = 0700;
281283
ORGANIZATIONNAME = "Giovanni Collazo";
282284
TargetAttributes = {
283285
7D25A7E11A697586007EC13C = {
@@ -393,6 +395,7 @@
393395
CODE_SIGN_IDENTITY = "-";
394396
COPY_PHASE_STRIP = NO;
395397
ENABLE_STRICT_OBJC_MSGSEND = YES;
398+
ENABLE_TESTABILITY = YES;
396399
GCC_C_LANGUAGE_STANDARD = gnu99;
397400
GCC_DYNAMIC_NO_PIC = NO;
398401
GCC_OPTIMIZATION_LEVEL = 0;
@@ -466,6 +469,7 @@
466469
INFOPLIST_FILE = MongoDB/Info.plist;
467470
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
468471
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
472+
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
469473
PRODUCT_NAME = "$(TARGET_NAME)";
470474
PROVISIONING_PROFILE = "";
471475
SWIFT_OBJC_BRIDGING_HEADER = "MongoDB-Bridging-Header.h";
@@ -489,6 +493,7 @@
489493
INFOPLIST_FILE = MongoDB/Info.plist;
490494
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
491495
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
496+
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
492497
PRODUCT_NAME = "$(TARGET_NAME)";
493498
PROVISIONING_PROFILE = "";
494499
SWIFT_OBJC_BRIDGING_HEADER = "MongoDB-Bridging-Header.h";
@@ -510,6 +515,7 @@
510515
);
511516
INFOPLIST_FILE = MongoDBTests/Info.plist;
512517
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
518+
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
513519
PRODUCT_NAME = "$(TARGET_NAME)";
514520
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MongoDB.app/Contents/MacOS/MongoDB";
515521
};
@@ -526,6 +532,7 @@
526532
);
527533
INFOPLIST_FILE = MongoDBTests/Info.plist;
528534
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
535+
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
529536
PRODUCT_NAME = "$(TARGET_NAME)";
530537
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MongoDB.app/Contents/MacOS/MongoDB";
531538
};

MongoDB/AppDelegate.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
5555
self.task.arguments = ["--dbpath", self.dataPath, "--nounixsocket"]
5656
self.task.standardOutput = self.pipe
5757

58-
println("Run mongod")
58+
print("Run mongod")
5959

6060
self.task.launch()
6161
}
6262

6363
func stopServer() {
64-
println("Terminate mongod")
64+
print("Terminate mongod")
6565
task.terminate()
6666

6767
let data: NSData = self.file.readDataToEndOfFile()
6868
self.file.closeFile()
6969

7070
let output: String = NSString(data: data, encoding: NSUTF8StringEncoding)! as String
71-
println(output)
71+
print(output)
7272
}
7373

7474
func openMongo(sender: AnyObject) {
@@ -87,18 +87,19 @@ class AppDelegate: NSObject, NSApplicationDelegate {
8787
}
8888

8989
func createDataDirectory() {
90-
println("Create data directory")
91-
var error: NSError?
92-
9390
if (!NSFileManager.defaultManager().fileExistsAtPath(self.dataPath)) {
94-
NSFileManager.defaultManager().createDirectoryAtPath(self.dataPath,
95-
withIntermediateDirectories: false, attributes: nil, error: &error)
91+
do {
92+
try NSFileManager.defaultManager().createDirectoryAtPath(self.dataPath,
93+
withIntermediateDirectories: false, attributes: nil)
94+
} catch {
95+
print("Something went wrong creating data directory")
96+
}
9697
}
97-
println("Mongo data directory: \(self.dataPath)")
98+
print("Mongo data directory: \(self.dataPath)")
9899
}
99100

100101
func checkForUpdates(sender: AnyObject?) {
101-
println("Checking for updates")
102+
print("Checking for updates")
102103
self.updater.checkForUpdates(sender)
103104
}
104105

@@ -107,9 +108,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
107108
statusBarItem = statusBar.statusItemWithLength(-1)
108109
statusBarItem.menu = menu
109110

110-
var icon = NSImage(named: "leaf")
111-
icon?.size = NSSize(width: 18, height: 16)
112-
icon?.setTemplate(true)
111+
let icon = NSImage(named: "leaf")
112+
icon!.size = NSSize(width: 18, height: 16)
113113
statusBarItem.image = icon
114114

115115
// Add version to menu

MongoDB/Info.plist

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
<key>CFBundleIconFile</key>
1010
<string></string>
1111
<key>CFBundleIdentifier</key>
12-
<string>io.blimp.$(PRODUCT_NAME:rfc1034identifier)</string>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>
1616
<string>$(PRODUCT_NAME)</string>
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>3.0.3-build.2</string>
20+
<string>3.0.5-build.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>3.0.3-build.2</string>
24+
<string>3.0.5-build.1</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.developer-tools</string>
2727
<key>LSMinimumSystemVersion</key>

MongoDBTests/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
10-
<string>io.blimp.$(PRODUCT_NAME:rfc1034identifier)</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

0 commit comments

Comments
 (0)