From e1a48594502f3bfe9d59d7d475fd00579114b439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Manuel=20Sa=CC=81nchez?= Date: Mon, 8 Jun 2015 16:19:02 +0200 Subject: [PATCH 1/4] Fixed compilation --- SwiftFilePath/Path.swift | 2 +- SwiftFilePath/PathExtensionDir.swift | 8 ++++---- SwiftFilePathTests/SwiftFilePathTests.swift | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SwiftFilePath/Path.swift b/SwiftFilePath/Path.swift index 7784c1c..f81d16a 100644 --- a/SwiftFilePath/Path.swift +++ b/SwiftFilePath/Path.swift @@ -12,7 +12,7 @@ public class Path { public class func isDir(path:NSString) -> Bool { var isDirectory: ObjCBool = false - let isFileExists = NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory:&isDirectory) + let isFileExists = NSFileManager.defaultManager().fileExistsAtPath(path as String, isDirectory:&isDirectory) return isDirectory ? true : false } diff --git a/SwiftFilePath/PathExtensionDir.swift b/SwiftFilePath/PathExtensionDir.swift index 9ce89f4..8156db0 100644 --- a/SwiftFilePath/PathExtensionDir.swift +++ b/SwiftFilePath/PathExtensionDir.swift @@ -29,7 +29,7 @@ extension Path { } private class func userDomainOf(pathEnum:NSSearchPathDirectory)->Path{ - let pathString = NSSearchPathForDirectoriesInDomains(pathEnum, .UserDomainMask, true)[0] as String + let pathString = NSSearchPathForDirectoriesInDomains(pathEnum, .UserDomainMask, true)[0] as! String return Path( pathString ) } @@ -54,7 +54,7 @@ extension Path: SequenceType { } return contents!.map({ [unowned self] content in - return self.content(content as String) + return self.content(content as! String) }) } @@ -64,7 +64,7 @@ extension Path: SequenceType { } public func content(path_string:NSString) -> Path { - return Path( self.path_string.stringByAppendingPathComponent(path_string) ) + return Path( self.path_string.stringByAppendingPathComponent(path_string as String) ) } public func child(path:NSString) -> Path { @@ -88,7 +88,7 @@ extension Path: SequenceType { assert(self.isDir,"To get iterator, path must be dir< \(path_string) >") let iterator = fileManager.enumeratorAtPath(path_string) return GeneratorOf() { - let optionalContent = iterator?.nextObject() as String? + let optionalContent = iterator?.nextObject() as! String? if var content = optionalContent { return self.content(content) } else { diff --git a/SwiftFilePathTests/SwiftFilePathTests.swift b/SwiftFilePathTests/SwiftFilePathTests.swift index e760f5b..87738d5 100644 --- a/SwiftFilePathTests/SwiftFilePathTests.swift +++ b/SwiftFilePathTests/SwiftFilePathTests.swift @@ -16,7 +16,7 @@ extension String { func match(pattern: String) -> Bool { var error : NSError? let matcher = NSRegularExpression(pattern: pattern, options: nil, error: &error) - return matcher?.numberOfMatchesInString(self, options: nil, range: NSMakeRange(0, self.utf16Count)) != 0 + return matcher?.numberOfMatchesInString(self, options: nil, range: NSMakeRange(0, count(self.utf16))) != 0 } } From 96b0caf9070dcd3ae35a0c618b2f258653b77c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Manuel=20Sa=CC=81nchez?= Date: Mon, 8 Jun 2015 16:56:16 +0200 Subject: [PATCH 2/4] Added target for mac --- SwiftFilePath-Mac/Info.plist | 28 ++ SwiftFilePath-Mac/SwiftFilePath-Mac.h | 19 ++ SwiftFilePath-MacTests/Info.plist | 24 ++ .../SwiftFilePath_MacTests.swift | 36 +++ SwiftFilePath.xcodeproj/project.pbxproj | 273 ++++++++++++++++++ SwiftFilePath/PathExtensionDir.swift | 4 +- SwiftFilePath/SwiftFilePath.h | 4 + SwiftFilePathTests/SwiftFilePathTests.swift | 9 +- 8 files changed, 391 insertions(+), 6 deletions(-) create mode 100644 SwiftFilePath-Mac/Info.plist create mode 100644 SwiftFilePath-Mac/SwiftFilePath-Mac.h create mode 100644 SwiftFilePath-MacTests/Info.plist create mode 100644 SwiftFilePath-MacTests/SwiftFilePath_MacTests.swift diff --git a/SwiftFilePath-Mac/Info.plist b/SwiftFilePath-Mac/Info.plist new file mode 100644 index 0000000..da4bb14 --- /dev/null +++ b/SwiftFilePath-Mac/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.jms.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2015 Norihiro Sakamoto. All rights reserved. + NSPrincipalClass + + + diff --git a/SwiftFilePath-Mac/SwiftFilePath-Mac.h b/SwiftFilePath-Mac/SwiftFilePath-Mac.h new file mode 100644 index 0000000..073ac41 --- /dev/null +++ b/SwiftFilePath-Mac/SwiftFilePath-Mac.h @@ -0,0 +1,19 @@ +// +// SwiftFilePath-Mac.h +// SwiftFilePath-Mac +// +// Created by Jose Manuel Sánchez Peñarroja on 8/6/15. +// Copyright (c) 2015 Norihiro Sakamoto. All rights reserved. +// + +#import + +//! Project version number for SwiftFilePath-Mac. +FOUNDATION_EXPORT double SwiftFilePath_MacVersionNumber; + +//! Project version string for SwiftFilePath-Mac. +FOUNDATION_EXPORT const unsigned char SwiftFilePath_MacVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/SwiftFilePath-MacTests/Info.plist b/SwiftFilePath-MacTests/Info.plist new file mode 100644 index 0000000..9ad31d1 --- /dev/null +++ b/SwiftFilePath-MacTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.jms.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/SwiftFilePath-MacTests/SwiftFilePath_MacTests.swift b/SwiftFilePath-MacTests/SwiftFilePath_MacTests.swift new file mode 100644 index 0000000..6be4874 --- /dev/null +++ b/SwiftFilePath-MacTests/SwiftFilePath_MacTests.swift @@ -0,0 +1,36 @@ +// +// SwiftFilePath_MacTests.swift +// SwiftFilePath-MacTests +// +// Created by Jose Manuel Sánchez Peñarroja on 8/6/15. +// Copyright (c) 2015 Norihiro Sakamoto. All rights reserved. +// + +import Cocoa +import XCTest + +class SwiftFilePath_MacTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + XCTAssert(true, "Pass") + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measureBlock() { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/SwiftFilePath.xcodeproj/project.pbxproj b/SwiftFilePath.xcodeproj/project.pbxproj index c352781..df4df91 100644 --- a/SwiftFilePath.xcodeproj/project.pbxproj +++ b/SwiftFilePath.xcodeproj/project.pbxproj @@ -7,6 +7,15 @@ objects = { /* Begin PBXBuildFile section */ + AC5B91621B25E0EB005D7562 /* SwiftFilePath-Mac.h in Headers */ = {isa = PBXBuildFile; fileRef = AC5B91611B25E0EB005D7562 /* SwiftFilePath-Mac.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AC5B91681B25E0EB005D7562 /* SwiftFilePath.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AC5B915D1B25E0EA005D7562 /* SwiftFilePath.framework */; }; + AC5B916F1B25E0EB005D7562 /* SwiftFilePath_MacTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = AC5B916E1B25E0EB005D7562 /* SwiftFilePath_MacTests.swift */; }; + AC5B91761B25E0F7005D7562 /* PathExtensionDir.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCB3A04D1A625A780034E098 /* PathExtensionDir.swift */; }; + AC5B91771B25E0F7005D7562 /* PathExtensionFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCB3A04E1A625A780034E098 /* PathExtensionFile.swift */; }; + AC5B91781B25E0F7005D7562 /* Path.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCB3A04B1A6254910034E098 /* Path.swift */; }; + AC5B91791B25E0FB005D7562 /* SwiftFilePath.h in Headers */ = {isa = PBXBuildFile; fileRef = CC7832F11A610124005E77C3 /* SwiftFilePath.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AC5B917A1B25E102005D7562 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC78331D1A6186B7005E77C3 /* Result.swift */; }; + AC5B917B1B25E10D005D7562 /* SwiftFilePathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7832FE1A610125005E77C3 /* SwiftFilePathTests.swift */; }; CC7832F21A610124005E77C3 /* SwiftFilePath.h in Headers */ = {isa = PBXBuildFile; fileRef = CC7832F11A610124005E77C3 /* SwiftFilePath.h */; settings = {ATTRIBUTES = (Public, ); }; }; CC7832F81A610125005E77C3 /* SwiftFilePath.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC7832EC1A610124005E77C3 /* SwiftFilePath.framework */; }; CC7832FF1A610125005E77C3 /* SwiftFilePathTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC7832FE1A610125005E77C3 /* SwiftFilePathTests.swift */; }; @@ -17,6 +26,13 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + AC5B91691B25E0EB005D7562 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = CC7832E31A610124005E77C3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = AC5B915C1B25E0EA005D7562; + remoteInfo = "SwiftFilePath-Mac"; + }; CC7832F91A610125005E77C3 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = CC7832E31A610124005E77C3 /* Project object */; @@ -27,6 +43,12 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + AC5B915D1B25E0EA005D7562 /* SwiftFilePath.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftFilePath.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AC5B91601B25E0EB005D7562 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AC5B91611B25E0EB005D7562 /* SwiftFilePath-Mac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwiftFilePath-Mac.h"; sourceTree = ""; }; + AC5B91671B25E0EB005D7562 /* SwiftFilePath-MacTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwiftFilePath-MacTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + AC5B916D1B25E0EB005D7562 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AC5B916E1B25E0EB005D7562 /* SwiftFilePath_MacTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftFilePath_MacTests.swift; sourceTree = ""; }; CC7832EC1A610124005E77C3 /* SwiftFilePath.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftFilePath.framework; sourceTree = BUILT_PRODUCTS_DIR; }; CC7832F01A610124005E77C3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; CC7832F11A610124005E77C3 /* SwiftFilePath.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftFilePath.h; sourceTree = ""; }; @@ -40,6 +62,21 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + AC5B91591B25E0EA005D7562 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AC5B91641B25E0EB005D7562 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AC5B91681B25E0EB005D7562 /* SwiftFilePath.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; CC7832E81A610124005E77C3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -58,11 +95,47 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + AC5B915E1B25E0EB005D7562 /* SwiftFilePath-Mac */ = { + isa = PBXGroup; + children = ( + AC5B91611B25E0EB005D7562 /* SwiftFilePath-Mac.h */, + AC5B915F1B25E0EB005D7562 /* Supporting Files */, + ); + path = "SwiftFilePath-Mac"; + sourceTree = ""; + }; + AC5B915F1B25E0EB005D7562 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + AC5B91601B25E0EB005D7562 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + AC5B916B1B25E0EB005D7562 /* SwiftFilePath-MacTests */ = { + isa = PBXGroup; + children = ( + AC5B916E1B25E0EB005D7562 /* SwiftFilePath_MacTests.swift */, + AC5B916C1B25E0EB005D7562 /* Supporting Files */, + ); + path = "SwiftFilePath-MacTests"; + sourceTree = ""; + }; + AC5B916C1B25E0EB005D7562 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + AC5B916D1B25E0EB005D7562 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; CC7832E21A610124005E77C3 = { isa = PBXGroup; children = ( CC7832EE1A610124005E77C3 /* SwiftFilePath */, CC7832FB1A610125005E77C3 /* SwiftFilePathTests */, + AC5B915E1B25E0EB005D7562 /* SwiftFilePath-Mac */, + AC5B916B1B25E0EB005D7562 /* SwiftFilePath-MacTests */, CC7832ED1A610124005E77C3 /* Products */, ); sourceTree = ""; @@ -72,6 +145,8 @@ children = ( CC7832EC1A610124005E77C3 /* SwiftFilePath.framework */, CC7832F71A610125005E77C3 /* SwiftFilePathTests.xctest */, + AC5B915D1B25E0EA005D7562 /* SwiftFilePath.framework */, + AC5B91671B25E0EB005D7562 /* SwiftFilePath-MacTests.xctest */, ); name = Products; sourceTree = ""; @@ -117,6 +192,15 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + AC5B915A1B25E0EA005D7562 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + AC5B91621B25E0EB005D7562 /* SwiftFilePath-Mac.h in Headers */, + AC5B91791B25E0FB005D7562 /* SwiftFilePath.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; CC7832E91A610124005E77C3 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -128,6 +212,42 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + AC5B915C1B25E0EA005D7562 /* SwiftFilePath-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = AC5B91741B25E0EB005D7562 /* Build configuration list for PBXNativeTarget "SwiftFilePath-Mac" */; + buildPhases = ( + AC5B91581B25E0EA005D7562 /* Sources */, + AC5B91591B25E0EA005D7562 /* Frameworks */, + AC5B915A1B25E0EA005D7562 /* Headers */, + AC5B915B1B25E0EA005D7562 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "SwiftFilePath-Mac"; + productName = "SwiftFilePath-Mac"; + productReference = AC5B915D1B25E0EA005D7562 /* SwiftFilePath.framework */; + productType = "com.apple.product-type.framework"; + }; + AC5B91661B25E0EB005D7562 /* SwiftFilePath-MacTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = AC5B91751B25E0EB005D7562 /* Build configuration list for PBXNativeTarget "SwiftFilePath-MacTests" */; + buildPhases = ( + AC5B91631B25E0EB005D7562 /* Sources */, + AC5B91641B25E0EB005D7562 /* Frameworks */, + AC5B91651B25E0EB005D7562 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + AC5B916A1B25E0EB005D7562 /* PBXTargetDependency */, + ); + name = "SwiftFilePath-MacTests"; + productName = "SwiftFilePath-MacTests"; + productReference = AC5B91671B25E0EB005D7562 /* SwiftFilePath-MacTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; CC7832EB1A610124005E77C3 /* SwiftFilePath */ = { isa = PBXNativeTarget; buildConfigurationList = CC7833021A610125005E77C3 /* Build configuration list for PBXNativeTarget "SwiftFilePath" */; @@ -173,6 +293,12 @@ LastUpgradeCheck = 0610; ORGANIZATIONNAME = "Norihiro Sakamoto"; TargetAttributes = { + AC5B915C1B25E0EA005D7562 = { + CreatedOnToolsVersion = 6.3.2; + }; + AC5B91661B25E0EB005D7562 = { + CreatedOnToolsVersion = 6.3.2; + }; CC7832EB1A610124005E77C3 = { CreatedOnToolsVersion = 6.1; }; @@ -195,11 +321,27 @@ targets = ( CC7832EB1A610124005E77C3 /* SwiftFilePath */, CC7832F61A610125005E77C3 /* SwiftFilePathTests */, + AC5B915C1B25E0EA005D7562 /* SwiftFilePath-Mac */, + AC5B91661B25E0EB005D7562 /* SwiftFilePath-MacTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + AC5B915B1B25E0EA005D7562 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AC5B91651B25E0EB005D7562 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; CC7832EA1A610124005E77C3 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -217,6 +359,26 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + AC5B91581B25E0EA005D7562 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AC5B91771B25E0F7005D7562 /* PathExtensionFile.swift in Sources */, + AC5B91781B25E0F7005D7562 /* Path.swift in Sources */, + AC5B917A1B25E102005D7562 /* Result.swift in Sources */, + AC5B91761B25E0F7005D7562 /* PathExtensionDir.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + AC5B91631B25E0EB005D7562 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AC5B917B1B25E10D005D7562 /* SwiftFilePathTests.swift in Sources */, + AC5B916F1B25E0EB005D7562 /* SwiftFilePath_MacTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; CC7832E71A610124005E77C3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -239,6 +401,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + AC5B916A1B25E0EB005D7562 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = AC5B915C1B25E0EA005D7562 /* SwiftFilePath-Mac */; + targetProxy = AC5B91691B25E0EB005D7562 /* PBXContainerItemProxy */; + }; CC7832FA1A610125005E77C3 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = CC7832EB1A610124005E77C3 /* SwiftFilePath */; @@ -247,6 +414,96 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + AC5B91701B25E0EB005D7562 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "SwiftFilePath-Mac/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_MODULE_NAME = SwiftFilePath; + PRODUCT_NAME = SwiftFilePath; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + AC5B91711B25E0EB005D7562 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "SwiftFilePath-Mac/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_MODULE_NAME = SwiftFilePath; + PRODUCT_NAME = SwiftFilePath; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; + AC5B91721B25E0EB005D7562 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "SwiftFilePath-MacTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Debug; + }; + AC5B91731B25E0EB005D7562 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "SwiftFilePath-MacTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + }; + name = Release; + }; CC7833001A610125005E77C3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -397,6 +654,22 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + AC5B91741B25E0EB005D7562 /* Build configuration list for PBXNativeTarget "SwiftFilePath-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AC5B91701B25E0EB005D7562 /* Debug */, + AC5B91711B25E0EB005D7562 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + AC5B91751B25E0EB005D7562 /* Build configuration list for PBXNativeTarget "SwiftFilePath-MacTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AC5B91721B25E0EB005D7562 /* Debug */, + AC5B91731B25E0EB005D7562 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; CC7832E61A610124005E77C3 /* Build configuration list for PBXProject "SwiftFilePath" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/SwiftFilePath/PathExtensionDir.swift b/SwiftFilePath/PathExtensionDir.swift index 8156db0..db86358 100644 --- a/SwiftFilePath/PathExtensionDir.swift +++ b/SwiftFilePath/PathExtensionDir.swift @@ -7,7 +7,7 @@ // // Instance Factories for accessing to readable iOS dirs. -#if os(iOS) +//#if os(iOS) extension Path { public class var homeDir :Path{ @@ -34,7 +34,7 @@ extension Path { } } -#endif +//#endif // Add Dir Behavior to Path by extension extension Path: SequenceType { diff --git a/SwiftFilePath/SwiftFilePath.h b/SwiftFilePath/SwiftFilePath.h index ff75ecd..4677c28 100644 --- a/SwiftFilePath/SwiftFilePath.h +++ b/SwiftFilePath/SwiftFilePath.h @@ -6,7 +6,11 @@ // Copyright (c) 2015年 Norihiro Sakamoto. All rights reserved. // +#import + +#if TARGET_OS_IPHONE #import +#endif //! Project version number for SwiftFilePath. FOUNDATION_EXPORT double SwiftFilePathVersionNumber; diff --git a/SwiftFilePathTests/SwiftFilePathTests.swift b/SwiftFilePathTests/SwiftFilePathTests.swift index 87738d5..1b9316e 100644 --- a/SwiftFilePathTests/SwiftFilePathTests.swift +++ b/SwiftFilePathTests/SwiftFilePathTests.swift @@ -24,7 +24,8 @@ extension String { // MARK: Test cases class SwiftFilePathTests: XCTestCase { - +// #if os(iOS) + let sandboxDir = Path.temporaryDir.content("sandbox") override func setUp() { @@ -44,7 +45,7 @@ class SwiftFilePathTests: XCTestCase { // MARK: - #if os(iOS) + func testDirFactories() { let homeDir = Path.homeDir @@ -68,7 +69,6 @@ class SwiftFilePathTests: XCTestCase { ) } - #endif func testDir(){ let dir = sandboxDir.content("bar") @@ -124,7 +124,8 @@ class SwiftFilePathTests: XCTestCase { } - +// #endif + func testMkdirAndRemove(){ let fruitsDir = sandboxDir.content("fruits") From 4a9fa7a984b86ec92bc98a5f69f9d8cbae361666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Manuel=20Sa=CC=81nchez?= Date: Mon, 8 Jun 2015 17:29:38 +0200 Subject: [PATCH 3/4] Shared mac scheme --- .../xcschemes/SwiftFilePath-Mac.xcscheme | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme diff --git a/SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme b/SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme new file mode 100644 index 0000000..80b1713 --- /dev/null +++ b/SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2920adf31799b18eb3ea6eca0142fd6db6a72c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Manuel=20Sa=CC=81nchez?= Date: Mon, 8 Jun 2015 17:30:37 +0200 Subject: [PATCH 4/4] Shared scheme --- .../xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme b/SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme index 80b1713..8694ef1 100644 --- a/SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme +++ b/SwiftFilePath.xcodeproj/xcshareddata/xcschemes/SwiftFilePath-Mac.xcscheme @@ -15,7 +15,7 @@ @@ -57,7 +57,7 @@ @@ -76,7 +76,7 @@ @@ -94,7 +94,7 @@