Skip to content

Commit

Permalink
Swift 2 migration tool updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gcollazo committed Aug 23, 2015
1 parent db84c8e commit a1b263a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
9 changes: 8 additions & 1 deletion MongoDB.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@
7D25A7DA1A697586007EC13C /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Giovanni Collazo";
TargetAttributes = {
7D25A7E11A697586007EC13C = {
Expand Down Expand Up @@ -393,6 +395,7 @@
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -466,6 +469,7 @@
INFOPLIST_FILE = MongoDB/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "MongoDB-Bridging-Header.h";
Expand All @@ -489,6 +493,7 @@
INFOPLIST_FILE = MongoDB/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
OTHER_LDFLAGS = "-Wl,-rpath,@loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = "MongoDB-Bridging-Header.h";
Expand All @@ -510,6 +515,7 @@
);
INFOPLIST_FILE = MongoDBTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MongoDB.app/Contents/MacOS/MongoDB";
};
Expand All @@ -526,6 +532,7 @@
);
INFOPLIST_FILE = MongoDBTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "io.blimp.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MongoDB.app/Contents/MacOS/MongoDB";
};
Expand Down
26 changes: 13 additions & 13 deletions MongoDB/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self.task.arguments = ["--dbpath", self.dataPath, "--nounixsocket"]
self.task.standardOutput = self.pipe

println("Run mongod")
print("Run mongod")

self.task.launch()
}

func stopServer() {
println("Terminate mongod")
print("Terminate mongod")
task.terminate()

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

let output: String = NSString(data: data, encoding: NSUTF8StringEncoding)! as String
println(output)
print(output)
}

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

func createDataDirectory() {
println("Create data directory")
var error: NSError?

if (!NSFileManager.defaultManager().fileExistsAtPath(self.dataPath)) {
NSFileManager.defaultManager().createDirectoryAtPath(self.dataPath,
withIntermediateDirectories: false, attributes: nil, error: &error)
do {
try NSFileManager.defaultManager().createDirectoryAtPath(self.dataPath,
withIntermediateDirectories: false, attributes: nil)
} catch {
print("Something went wrong creating data directory")
}
}
println("Mongo data directory: \(self.dataPath)")
print("Mongo data directory: \(self.dataPath)")
}

func checkForUpdates(sender: AnyObject?) {
println("Checking for updates")
print("Checking for updates")
self.updater.checkForUpdates(sender)
}

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

var icon = NSImage(named: "leaf")
icon?.size = NSSize(width: 18, height: 16)
icon?.setTemplate(true)
let icon = NSImage(named: "leaf")
icon!.size = NSSize(width: 18, height: 16)
statusBarItem.image = icon

// Add version to menu
Expand Down
6 changes: 3 additions & 3 deletions MongoDB/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>io.blimp.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0.3-build.2</string>
<string>3.0.5-build.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.0.3-build.2</string>
<string>3.0.5-build.1</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion MongoDBTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>io.blimp.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down

0 comments on commit a1b263a

Please sign in to comment.