From 9efa9734588ecb74af3eb0819d0564082dd7c3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loi=CC=88s=20Di=20Qual?= Date: Fri, 1 Apr 2016 20:12:54 -0700 Subject: [PATCH] Added carthage support + Carthage integration tests. Fixes #3 --- .gitignore | 6 +- .travis.yml | 5 +- CHANGELOG.md | 2 + CarthageIntegrationTest/.gitignore | 2 + CarthageIntegrationTest/Cartfile | 1 + .../project.pbxproj | 309 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../CarthageIntegrationTest.h | 19 ++ .../CarthageIntegrationTest/Info.plist | 26 ++ .../CarthageIntegrationTest/Main.swift | 14 + README.md | 9 + 11 files changed, 396 insertions(+), 4 deletions(-) create mode 100644 CarthageIntegrationTest/.gitignore create mode 100644 CarthageIntegrationTest/Cartfile create mode 100644 CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.pbxproj create mode 100644 CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 CarthageIntegrationTest/CarthageIntegrationTest/CarthageIntegrationTest.h create mode 100644 CarthageIntegrationTest/CarthageIntegrationTest/Info.plist create mode 100644 CarthageIntegrationTest/CarthageIntegrationTest/Main.swift diff --git a/.gitignore b/.gitignore index 75b7bb7..4b7e96b 100644 --- a/.gitignore +++ b/.gitignore @@ -34,11 +34,11 @@ xcuserdata # you should judge for yourself, the pros and cons are mentioned at: # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control # -# Pods/ +Pods/ -# Carthage +Carthage # # Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts +Carthage/Checkouts Carthage/Build diff --git a/.travis.yml b/.travis.yml index bc02569..8b37933 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,5 +10,8 @@ xcode_sdk: - iphonesimulator9.3 before_install: - gem install scan -v '0.5.2' + - brew install carthage script: - - scan \ No newline at end of file + - scan + - cd CarthageIntegrationTest && carthage bootstrap && xcodebuild -configuration Debug -project CarthageIntegrationTest.xcodeproj -sdk iphonesimulator + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f1924..cfd1b46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ SwiftyRSA Changelog # [master] + - Added Carthage support. + # [0.2.0] - Added NSData encryption/decryption. diff --git a/CarthageIntegrationTest/.gitignore b/CarthageIntegrationTest/.gitignore new file mode 100644 index 0000000..036952e --- /dev/null +++ b/CarthageIntegrationTest/.gitignore @@ -0,0 +1,2 @@ +# We're ignoring the .resolved file so Carthage always fetches master during Travis CI tests +Cartfile.resolved diff --git a/CarthageIntegrationTest/Cartfile b/CarthageIntegrationTest/Cartfile new file mode 100644 index 0000000..d4e42f3 --- /dev/null +++ b/CarthageIntegrationTest/Cartfile @@ -0,0 +1 @@ +github "TakeScoop/SwiftyRSA" "master" diff --git a/CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.pbxproj b/CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7bd3060 --- /dev/null +++ b/CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.pbxproj @@ -0,0 +1,309 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + C0646A5A1CAF644800587FF1 /* CarthageIntegrationTest.h in Headers */ = {isa = PBXBuildFile; fileRef = C0646A591CAF644800587FF1 /* CarthageIntegrationTest.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0646A621CAF647900587FF1 /* Main.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0646A611CAF647900587FF1 /* Main.swift */; }; + C0646A641CAF667600587FF1 /* SwiftyRSA.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0646A631CAF667600587FF1 /* SwiftyRSA.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + C0646A561CAF644800587FF1 /* CarthageIntegrationTest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CarthageIntegrationTest.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C0646A591CAF644800587FF1 /* CarthageIntegrationTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CarthageIntegrationTest.h; sourceTree = ""; }; + C0646A5B1CAF644800587FF1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C0646A611CAF647900587FF1 /* Main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Main.swift; sourceTree = ""; }; + C0646A631CAF667600587FF1 /* SwiftyRSA.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyRSA.framework; path = Carthage/Build/iOS/SwiftyRSA.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C0646A521CAF644800587FF1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C0646A641CAF667600587FF1 /* SwiftyRSA.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + C0646A4C1CAF644800587FF1 = { + isa = PBXGroup; + children = ( + C0646A631CAF667600587FF1 /* SwiftyRSA.framework */, + C0646A581CAF644800587FF1 /* CarthageIntegrationTest */, + C0646A571CAF644800587FF1 /* Products */, + ); + sourceTree = ""; + }; + C0646A571CAF644800587FF1 /* Products */ = { + isa = PBXGroup; + children = ( + C0646A561CAF644800587FF1 /* CarthageIntegrationTest.framework */, + ); + name = Products; + sourceTree = ""; + }; + C0646A581CAF644800587FF1 /* CarthageIntegrationTest */ = { + isa = PBXGroup; + children = ( + C0646A591CAF644800587FF1 /* CarthageIntegrationTest.h */, + C0646A5B1CAF644800587FF1 /* Info.plist */, + C0646A611CAF647900587FF1 /* Main.swift */, + ); + path = CarthageIntegrationTest; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + C0646A531CAF644800587FF1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C0646A5A1CAF644800587FF1 /* CarthageIntegrationTest.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + C0646A551CAF644800587FF1 /* CarthageIntegrationTest */ = { + isa = PBXNativeTarget; + buildConfigurationList = C0646A5E1CAF644800587FF1 /* Build configuration list for PBXNativeTarget "CarthageIntegrationTest" */; + buildPhases = ( + C0646A511CAF644800587FF1 /* Sources */, + C0646A521CAF644800587FF1 /* Frameworks */, + C0646A531CAF644800587FF1 /* Headers */, + C0646A541CAF644800587FF1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = CarthageIntegrationTest; + productName = CarthageIntegrationTest; + productReference = C0646A561CAF644800587FF1 /* CarthageIntegrationTest.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C0646A4D1CAF644800587FF1 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = "Loïs Di Qual"; + TargetAttributes = { + C0646A551CAF644800587FF1 = { + CreatedOnToolsVersion = 7.3; + }; + }; + }; + buildConfigurationList = C0646A501CAF644800587FF1 /* Build configuration list for PBXProject "CarthageIntegrationTest" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = C0646A4C1CAF644800587FF1; + productRefGroup = C0646A571CAF644800587FF1 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C0646A551CAF644800587FF1 /* CarthageIntegrationTest */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C0646A541CAF644800587FF1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C0646A511CAF644800587FF1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C0646A621CAF647900587FF1 /* Main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + C0646A5C1CAF644800587FF1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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.3; + 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; + }; + C0646A5D1CAF644800587FF1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + 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.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + C0646A5F1CAF644800587FF1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = CarthageIntegrationTest/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.loisdiqual.CarthageIntegrationTest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + C0646A601CAF644800587FF1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = CarthageIntegrationTest/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.loisdiqual.CarthageIntegrationTest; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C0646A501CAF644800587FF1 /* Build configuration list for PBXProject "CarthageIntegrationTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C0646A5C1CAF644800587FF1 /* Debug */, + C0646A5D1CAF644800587FF1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C0646A5E1CAF644800587FF1 /* Build configuration list for PBXNativeTarget "CarthageIntegrationTest" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C0646A5F1CAF644800587FF1 /* Debug */, + C0646A601CAF644800587FF1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C0646A4D1CAF644800587FF1 /* Project object */; +} diff --git a/CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6fa842d --- /dev/null +++ b/CarthageIntegrationTest/CarthageIntegrationTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CarthageIntegrationTest/CarthageIntegrationTest/CarthageIntegrationTest.h b/CarthageIntegrationTest/CarthageIntegrationTest/CarthageIntegrationTest.h new file mode 100644 index 0000000..a9ea83a --- /dev/null +++ b/CarthageIntegrationTest/CarthageIntegrationTest/CarthageIntegrationTest.h @@ -0,0 +1,19 @@ +// +// CarthageIntegrationTest.h +// CarthageIntegrationTest +// +// Created by Loïs Di Qual on 4/1/16. +// Copyright © 2016 Loïs Di Qual. All rights reserved. +// + +#import + +//! Project version number for CarthageIntegrationTest. +FOUNDATION_EXPORT double CarthageIntegrationTestVersionNumber; + +//! Project version string for CarthageIntegrationTest. +FOUNDATION_EXPORT const unsigned char CarthageIntegrationTestVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/CarthageIntegrationTest/CarthageIntegrationTest/Info.plist b/CarthageIntegrationTest/CarthageIntegrationTest/Info.plist new file mode 100644 index 0000000..d3de8ee --- /dev/null +++ b/CarthageIntegrationTest/CarthageIntegrationTest/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 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/CarthageIntegrationTest/CarthageIntegrationTest/Main.swift b/CarthageIntegrationTest/CarthageIntegrationTest/Main.swift new file mode 100644 index 0000000..5a9601c --- /dev/null +++ b/CarthageIntegrationTest/CarthageIntegrationTest/Main.swift @@ -0,0 +1,14 @@ +// +// Main.swift +// CarthageIntegrationTest +// +// Created by Loïs Di Qual on 4/1/16. +// Copyright © 2016 Loïs Di Qual. All rights reserved. +// + +import Foundation +import SwiftyRSA + +func main() { + print("\(SwiftyRSA.self)") +} diff --git a/README.md b/README.md index bca4381..cab4a9f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ SwiftyRSA ========= ![](https://img.shields.io/cocoapods/v/SwiftyRSA.svg) +![](https://img.shields.io/badge/carthage-compatible-brightgreen.svg) ![](https://img.shields.io/cocoapods/p/SwiftyRSA.svg) ![](https://img.shields.io/badge/language-swift_2\+-brightgreen.svg) ![](https://img.shields.io/travis/TakeScoop/SwiftyRSA/master.svg) @@ -13,10 +14,18 @@ SwiftyRSA is used in the [Scoop](https://www.takescoop.com/) [iOS app](https://i Installation ------------ +With Cocoapods: + ``` pod 'SwiftyRSA' ``` +With Carthage: + +``` +github "TakeScoop/SwiftyRSA" +``` + Usage -----