diff --git a/.gitignore b/.gitignore index 0e0def8..d092cf8 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ DerivedData .idea/ *.hmap *.xccheckout -Pods \ No newline at end of file +Pods +iOSSnapshotTestCaseCarthageDemo/Carthage/Checkouts +iOSSnapshotTestCaseCarthageDemo/Carthage/Build \ No newline at end of file diff --git a/build.sh b/build.sh index dd7a555..25bd7ef 100755 --- a/build.sh +++ b/build.sh @@ -31,5 +31,22 @@ function ci_demo() { popd } +function ci_carthage_demo() { + NAME=$1 + pushd iOSSnapshotTestCaseCarthageDemo + carthage bootstrap + xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \ + -scheme iOSSnapshotTestCaseCarthageDemo \ + -destination "platform=iOS Simulator,name=${NAME}" \ + build-for-testing + xcodebuild -project iOSSnapshotTestCaseCarthageDemo.xcodeproj \ + -scheme iOSSnapshotTestCaseCarthageDemo \ + -destination "platform=iOS Simulator,name=${NAME}" \ + test-without-building + popd +} + ci_lib "iPhone 7" && ci_demo "iPhone 7" ci_lib "iPhone X" && ci_demo "iPhone X" +ci_lib "iPhone 7" && ci_carthage_demo "iPhone 7" +ci_lib "iPhone X" && ci_carthage_demo "iPhone X" diff --git a/docs/HowToRelease.md b/docs/HowToRelease.md new file mode 100644 index 0000000..716528e --- /dev/null +++ b/docs/HowToRelease.md @@ -0,0 +1,7 @@ += How to Release = +1. Update the CHANGELOG.md +2. Tag the commit in master with `git tag version-number`; e.g., `git tag 0.0.1` +3. Push the tag with `git push --tags` +4. `pod trunk push iOSSnapshotTestCase.podspec` +5. `carthage build --archive --configuration Debug` +2. Upload the `FBSnapshotTestCase.framework.zip` to the tagged release on Github for the version number diff --git a/iOSSnapshotTestCaseCarthageDemo/Cartfile b/iOSSnapshotTestCaseCarthageDemo/Cartfile new file mode 100644 index 0000000..04f83c0 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/Cartfile @@ -0,0 +1 @@ +github "uber/ios-snapshot-test-case" ~> 5.0.1 \ No newline at end of file diff --git a/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved b/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved new file mode 100644 index 0000000..c6bbb7c --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/Cartfile.resolved @@ -0,0 +1 @@ +github "uber/ios-snapshot-test-case" "5.0.2" diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..4d53e81 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.pbxproj @@ -0,0 +1,483 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + E793D4A321ED6CB3001039B0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E793D4A221ED6CB3001039B0 /* AppDelegate.swift */; }; + E793D4AA21ED6CB4001039B0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E793D4A921ED6CB4001039B0 /* Assets.xcassets */; }; + E793D4AD21ED6CB4001039B0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E793D4AB21ED6CB4001039B0 /* LaunchScreen.storyboard */; }; + E7E942DF21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E7E942DE21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.swift */; }; + E7E942E821ED6F47005BC62E /* FBSnapshotTestCase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E942E721ED6F47005BC62E /* FBSnapshotTestCase.framework */; }; + E7E942EA21ED704D005BC62E /* FBSnapshotTestCase.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E7E942E721ED6F47005BC62E /* FBSnapshotTestCase.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + E7E942E121ED6EE1005BC62E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E793D49721ED6CB3001039B0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = E793D49E21ED6CB3001039B0; + remoteInfo = iOSSnapshotTestCaseCarthageDemo; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E7E942E921ED7039005BC62E /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + E7E942EA21ED704D005BC62E /* FBSnapshotTestCase.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + E793D49F21ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iOSSnapshotTestCaseCarthageDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E793D4A221ED6CB3001039B0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + E793D4A921ED6CB4001039B0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + E793D4AC21ED6CB4001039B0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + E793D4AE21ED6CB4001039B0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E7E942DC21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = iOSSnapshotTestCaseCarthageDemoSwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + E7E942DE21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSSnapshotTestCaseCarthageDemoSwiftTests.swift; sourceTree = ""; }; + E7E942E021ED6EE1005BC62E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E7E942E721ED6F47005BC62E /* FBSnapshotTestCase.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FBSnapshotTestCase.framework; path = Carthage/Build/iOS/FBSnapshotTestCase.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E793D49C21ED6CB3001039B0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E7E942D921ED6EE1005BC62E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E7E942E821ED6F47005BC62E /* FBSnapshotTestCase.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + E793D49621ED6CB3001039B0 = { + isa = PBXGroup; + children = ( + E793D4A121ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo */, + E7E942DD21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests */, + E793D4A021ED6CB3001039B0 /* Products */, + E7E942E621ED6F46005BC62E /* Frameworks */, + ); + sourceTree = ""; + }; + E793D4A021ED6CB3001039B0 /* Products */ = { + isa = PBXGroup; + children = ( + E793D49F21ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo.app */, + E7E942DC21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + E793D4A121ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo */ = { + isa = PBXGroup; + children = ( + E793D4A221ED6CB3001039B0 /* AppDelegate.swift */, + E793D4A921ED6CB4001039B0 /* Assets.xcassets */, + E793D4AB21ED6CB4001039B0 /* LaunchScreen.storyboard */, + E793D4AE21ED6CB4001039B0 /* Info.plist */, + ); + path = iOSSnapshotTestCaseCarthageDemo; + sourceTree = ""; + }; + E7E942DD21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests */ = { + isa = PBXGroup; + children = ( + E7E942DE21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.swift */, + E7E942E021ED6EE1005BC62E /* Info.plist */, + ); + path = iOSSnapshotTestCaseCarthageDemoSwiftTests; + sourceTree = ""; + }; + E7E942E621ED6F46005BC62E /* Frameworks */ = { + isa = PBXGroup; + children = ( + E7E942E721ED6F47005BC62E /* FBSnapshotTestCase.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E793D49E21ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = E793D4B121ED6CB4001039B0 /* Build configuration list for PBXNativeTarget "iOSSnapshotTestCaseCarthageDemo" */; + buildPhases = ( + E793D49B21ED6CB3001039B0 /* Sources */, + E793D49C21ED6CB3001039B0 /* Frameworks */, + E793D49D21ED6CB3001039B0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = iOSSnapshotTestCaseCarthageDemo; + productName = iOSSnapshotTestCaseCarthageDemo; + productReference = E793D49F21ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo.app */; + productType = "com.apple.product-type.application"; + }; + E7E942DB21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = E7E942E321ED6EE1005BC62E /* Build configuration list for PBXNativeTarget "iOSSnapshotTestCaseCarthageDemoSwiftTests" */; + buildPhases = ( + E7E942D821ED6EE1005BC62E /* Sources */, + E7E942D921ED6EE1005BC62E /* Frameworks */, + E7E942DA21ED6EE1005BC62E /* Resources */, + E7E942E921ED7039005BC62E /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + E7E942E221ED6EE1005BC62E /* PBXTargetDependency */, + ); + name = iOSSnapshotTestCaseCarthageDemoSwiftTests; + productName = iOSSnapshotTestCaseCarthageDemoSwiftTests; + productReference = E7E942DC21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E793D49721ED6CB3001039B0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Alan Zeino"; + TargetAttributes = { + E793D49E21ED6CB3001039B0 = { + CreatedOnToolsVersion = 10.1; + }; + E7E942DB21ED6EE1005BC62E = { + CreatedOnToolsVersion = 10.1; + TestTargetID = E793D49E21ED6CB3001039B0; + }; + }; + }; + buildConfigurationList = E793D49A21ED6CB3001039B0 /* Build configuration list for PBXProject "iOSSnapshotTestCaseCarthageDemo" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = E793D49621ED6CB3001039B0; + productRefGroup = E793D4A021ED6CB3001039B0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E793D49E21ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo */, + E7E942DB21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E793D49D21ED6CB3001039B0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E793D4AD21ED6CB4001039B0 /* LaunchScreen.storyboard in Resources */, + E793D4AA21ED6CB4001039B0 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E7E942DA21ED6EE1005BC62E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E793D49B21ED6CB3001039B0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E793D4A321ED6CB3001039B0 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E7E942D821ED6EE1005BC62E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E7E942DF21ED6EE1005BC62E /* iOSSnapshotTestCaseCarthageDemoSwiftTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + E7E942E221ED6EE1005BC62E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = E793D49E21ED6CB3001039B0 /* iOSSnapshotTestCaseCarthageDemo */; + targetProxy = E7E942E121ED6EE1005BC62E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + E793D4AB21ED6CB4001039B0 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E793D4AC21ED6CB4001039B0 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + E793D4AF21ED6CB4001039B0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + E793D4B021ED6CB4001039B0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + E793D4B221ED6CB4001039B0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = iOSSnapshotTestCaseCarthageDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.uber.iOSSnapshotTestCaseCarthageDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E793D4B321ED6CB4001039B0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = iOSSnapshotTestCaseCarthageDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.uber.iOSSnapshotTestCaseCarthageDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + E7E942E421ED6EE1005BC62E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.uber.iOSSnapshotTestCaseCarthageDemoSwiftTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSSnapshotTestCaseCarthageDemo.app/iOSSnapshotTestCaseCarthageDemo"; + }; + name = Debug; + }; + E7E942E521ED6EE1005BC62E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.uber.iOSSnapshotTestCaseCarthageDemoSwiftTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/iOSSnapshotTestCaseCarthageDemo.app/iOSSnapshotTestCaseCarthageDemo"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E793D49A21ED6CB3001039B0 /* Build configuration list for PBXProject "iOSSnapshotTestCaseCarthageDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E793D4AF21ED6CB4001039B0 /* Debug */, + E793D4B021ED6CB4001039B0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E793D4B121ED6CB4001039B0 /* Build configuration list for PBXNativeTarget "iOSSnapshotTestCaseCarthageDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E793D4B221ED6CB4001039B0 /* Debug */, + E793D4B321ED6CB4001039B0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E7E942E321ED6EE1005BC62E /* Build configuration list for PBXNativeTarget "iOSSnapshotTestCaseCarthageDemoSwiftTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E7E942E421ED6EE1005BC62E /* Debug */, + E7E942E521ED6EE1005BC62E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E793D49721ED6CB3001039B0 /* Project object */; +} diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..10c5058 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme new file mode 100644 index 0000000..bf33751 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo.xcodeproj/xcshareddata/xcschemes/iOSSnapshotTestCaseCarthageDemo.xcscheme @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift new file mode 100644 index 0000000..fc834f4 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/AppDelegate.swift @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017-2019, Uber Technologies, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? = UIWindow() + + override init() { + super.init() + + window?.frame = UIScreen.main.bounds + } + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + guard let window = window else { return false } + + window.rootViewController = UIViewController() + window.backgroundColor = UIColor.white + window.makeKeyAndVisible() + + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Info.plist b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Info.plist new file mode 100644 index 0000000..4222ac2 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemo/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png new file mode 100644 index 0000000..0609d6a Binary files /dev/null and b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@2x.png differ diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png new file mode 100644 index 0000000..2b96798 Binary files /dev/null and b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/ReferenceImages_64/iOSSnapshotTestCaseCarthageDemoSwiftTests.iOSSnapshotTestCaseCarthageDemoSwiftTests/testExample@3x.png differ diff --git a/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift new file mode 100644 index 0000000..0e84213 --- /dev/null +++ b/iOSSnapshotTestCaseCarthageDemo/iOSSnapshotTestCaseCarthageDemoSwiftTests/iOSSnapshotTestCaseCarthageDemoSwiftTests.swift @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017-2019, Uber Technologies, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import XCTest +import FBSnapshotTestCase + +class iOSSnapshotTestCaseCarthageDemoSwiftTests: FBSnapshotTestCase { + + override func setUp() { + super.setUp() + recordMode = false + } + + func testExample() { + let view = UIView(frame: CGRect(x: 0, y: 0, width: 64, height: 64)) + view.backgroundColor = UIColor.blue + FBSnapshotVerifyView(view) + FBSnapshotVerifyLayer(view.layer) + } +}