From 4104ce319ca7ce59d7de8d3234ec50c97a459111 Mon Sep 17 00:00:00 2001 From: David Keegan Date: Tue, 13 Oct 2015 13:30:37 -0700 Subject: [PATCH] Add project to build a Framework for Carthage: fix #91 --- .gitignore | 3 + Framework/Info.plist | 26 ++ Framework/NSDateTimeAgo.h | 19 ++ NSDate+Extension.swift | 4 +- NSDateTimeAgo.xcodeproj/project.pbxproj | 296 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcschemes/NSDateTimeAgo.xcscheme | 80 +++++ 7 files changed, 433 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Framework/Info.plist create mode 100644 Framework/NSDateTimeAgo.h create mode 100644 NSDateTimeAgo.xcodeproj/project.pbxproj create mode 100644 NSDateTimeAgo.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 NSDateTimeAgo.xcodeproj/xcshareddata/xcschemes/NSDateTimeAgo.xcscheme diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae31f2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +xcuserdata +Carthage diff --git a/Framework/Info.plist b/Framework/Info.plist new file mode 100644 index 0000000..e2ecf82 --- /dev/null +++ b/Framework/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.3 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Framework/NSDateTimeAgo.h b/Framework/NSDateTimeAgo.h new file mode 100644 index 0000000..c2b1921 --- /dev/null +++ b/Framework/NSDateTimeAgo.h @@ -0,0 +1,19 @@ +// +// NSDate-TimeAgo.h +// NSDate-TimeAgo +// +// Created by David Keegan on 10/13/15. +// Copyright © 2015 Kevin Lawler. All rights reserved. +// + +#import + +//! Project version number for NSDate-TimeAgo. +FOUNDATION_EXPORT double NSDate_TimeAgoVersionNumber; + +//! Project version string for NSDate-TimeAgo. +FOUNDATION_EXPORT const unsigned char NSDate_TimeAgoVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/NSDate+Extension.swift b/NSDate+Extension.swift index e7781a2..0175654 100644 --- a/NSDate+Extension.swift +++ b/NSDate+Extension.swift @@ -33,7 +33,7 @@ extension NSDate { // shows 1 or two letter abbreviation for units. // does not include 'ago' text ... just {value}{unit-abbreviation} // does not include interim summary options such as 'Just now' - var timeAgoSimple: String { + public var timeAgoSimple: String { let now = NSDate() let deltaSeconds = Int(fabs(timeIntervalSinceDate(now))) @@ -70,7 +70,7 @@ extension NSDate { return stringFromFormat("%%d%@yr", withValue: value) } - var timeAgo: String { + public var timeAgo: String { let now = NSDate() let deltaSeconds = Int(fabs(timeIntervalSinceDate(now))) diff --git a/NSDateTimeAgo.xcodeproj/project.pbxproj b/NSDateTimeAgo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..b762f89 --- /dev/null +++ b/NSDateTimeAgo.xcodeproj/project.pbxproj @@ -0,0 +1,296 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 833CD37C1BCD9BD90085A751 /* NSDateTimeAgo.h in Headers */ = {isa = PBXBuildFile; fileRef = 833CD37B1BCD9BD90085A751 /* NSDateTimeAgo.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 838CF4311BCD9CB900562CA9 /* NSDate+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 838CF4301BCD9CB900562CA9 /* NSDate+Extension.swift */; settings = {ASSET_TAGS = (); }; }; + 838CF4331BCD9CFF00562CA9 /* NSDateTimeAgo.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 838CF4321BCD9CFF00562CA9 /* NSDateTimeAgo.bundle */; settings = {ASSET_TAGS = (); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 833CD3781BCD9BD90085A751 /* NSDateTimeAgo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NSDateTimeAgo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 833CD37B1BCD9BD90085A751 /* NSDateTimeAgo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSDateTimeAgo.h"; sourceTree = ""; }; + 833CD37D1BCD9BD90085A751 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 838CF4301BCD9CB900562CA9 /* NSDate+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDate+Extension.swift"; sourceTree = SOURCE_ROOT; }; + 838CF4321BCD9CFF00562CA9 /* NSDateTimeAgo.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = NSDateTimeAgo.bundle; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 833CD3741BCD9BD90085A751 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 833CD36E1BCD9BD90085A751 = { + isa = PBXGroup; + children = ( + 833CD37A1BCD9BD90085A751 /* Framework */, + 833CD3791BCD9BD90085A751 /* Products */, + ); + sourceTree = ""; + }; + 833CD3791BCD9BD90085A751 /* Products */ = { + isa = PBXGroup; + children = ( + 833CD3781BCD9BD90085A751 /* NSDateTimeAgo.framework */, + ); + name = Products; + sourceTree = ""; + }; + 833CD37A1BCD9BD90085A751 /* Framework */ = { + isa = PBXGroup; + children = ( + 838CF4301BCD9CB900562CA9 /* NSDate+Extension.swift */, + 838CF4321BCD9CFF00562CA9 /* NSDateTimeAgo.bundle */, + 833CD37B1BCD9BD90085A751 /* NSDateTimeAgo.h */, + 833CD37D1BCD9BD90085A751 /* Info.plist */, + ); + path = Framework; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 833CD3751BCD9BD90085A751 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 833CD37C1BCD9BD90085A751 /* NSDateTimeAgo.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 833CD3771BCD9BD90085A751 /* NSDateTimeAgo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 833CD38C1BCD9BD90085A751 /* Build configuration list for PBXNativeTarget "NSDateTimeAgo" */; + buildPhases = ( + 833CD3731BCD9BD90085A751 /* Sources */, + 833CD3741BCD9BD90085A751 /* Frameworks */, + 833CD3751BCD9BD90085A751 /* Headers */, + 833CD3761BCD9BD90085A751 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NSDateTimeAgo; + productName = "NSDateTimeAgo"; + productReference = 833CD3781BCD9BD90085A751 /* NSDateTimeAgo.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 833CD36F1BCD9BD90085A751 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; + ORGANIZATIONNAME = "Kevin Lawler"; + TargetAttributes = { + 833CD3771BCD9BD90085A751 = { + CreatedOnToolsVersion = 7.0.1; + }; + }; + }; + buildConfigurationList = 833CD3721BCD9BD90085A751 /* Build configuration list for PBXProject "NSDateTimeAgo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 833CD36E1BCD9BD90085A751; + productRefGroup = 833CD3791BCD9BD90085A751 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 833CD3771BCD9BD90085A751 /* NSDateTimeAgo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 833CD3761BCD9BD90085A751 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 838CF4331BCD9CFF00562CA9 /* NSDateTimeAgo.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 833CD3731BCD9BD90085A751 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 838CF4311BCD9CB900562CA9 /* NSDate+Extension.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 833CD38A1BCD9BD90085A751 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 833CD38B1BCD9BD90085A751 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 833CD38D1BCD9BD90085A751 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Framework/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.kevinlawler.NSDateTimeAgo"; + PRODUCT_NAME = NSDateTimeAgo; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 833CD38E1BCD9BD90085A751 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Framework/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.kevinlawler.NSDateTimeAgo"; + PRODUCT_NAME = NSDateTimeAgo; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 833CD3721BCD9BD90085A751 /* Build configuration list for PBXProject "NSDateTimeAgo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 833CD38A1BCD9BD90085A751 /* Debug */, + 833CD38B1BCD9BD90085A751 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 833CD38C1BCD9BD90085A751 /* Build configuration list for PBXNativeTarget "NSDateTimeAgo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 833CD38D1BCD9BD90085A751 /* Debug */, + 833CD38E1BCD9BD90085A751 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 833CD36F1BCD9BD90085A751 /* Project object */; +} diff --git a/NSDateTimeAgo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/NSDateTimeAgo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..41ddb20 --- /dev/null +++ b/NSDateTimeAgo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/NSDateTimeAgo.xcodeproj/xcshareddata/xcschemes/NSDateTimeAgo.xcscheme b/NSDateTimeAgo.xcodeproj/xcshareddata/xcschemes/NSDateTimeAgo.xcscheme new file mode 100644 index 0000000..3c11d1e --- /dev/null +++ b/NSDateTimeAgo.xcodeproj/xcshareddata/xcschemes/NSDateTimeAgo.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +