From fd9f8303b790fa9cfccd39b8730141410f709373 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Tue, 17 Jun 2025 10:06:26 +1000 Subject: [PATCH] AINFRA-473 - Simplify Fakes into a Swift package --- Fakes/Fakes.xcodeproj/project.pbxproj | 422 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - Fakes/Fakes/Fakes.h | 18 - Fakes/Fakes/Fakes.xcconfig | 1 - Fakes/Fakes/Info.plist | 22 - Modules/Package.swift | 26 +- .../Sourcery/Fakes/Hardware-Fakes.yaml | 2 +- .../Sourcery/Fakes/Networking-Fakes.yaml | 4 +- .../Sourcery/Fakes/WooFoundation-Fakes.yaml | 4 +- .../Sourcery/Fakes/Yosemite-Fakes.yaml | 2 +- {Fakes => Modules/Sources}/Fakes/Fake.swift | 0 .../Sources}/Fakes/Hardware.generated.swift | 0 .../Sources}/Fakes/Networking.generated.swift | 0 .../Fakes/NetworkingCore.generated.swift | 0 .../Sources/Fakes}/ProductFactory.swift | 0 .../Fakes/WooFoundation.generated.swift | 0 .../Fakes/WooFoundationCore.generated.swift | 0 .../Sources}/Fakes/Yosemite.generated.swift | 0 .../XcodeTarget_Fakes/Empty.swift | 7 - .../Networking.xcodeproj/project.pbxproj | 4 - .../contents.xcworkspacedata | 3 - .../WooCommerce.xcodeproj/project.pbxproj | 4 - Yosemite/Yosemite.xcodeproj/project.pbxproj | 4 - docs/fakeable.md | 12 +- 25 files changed, 28 insertions(+), 522 deletions(-) delete mode 100644 Fakes/Fakes.xcodeproj/project.pbxproj delete mode 100644 Fakes/Fakes.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 Fakes/Fakes.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 Fakes/Fakes/Fakes.h delete mode 100644 Fakes/Fakes/Fakes.xcconfig delete mode 100644 Fakes/Fakes/Info.plist rename {Fakes => Modules/Sources}/Fakes/Fake.swift (100%) rename {Fakes => Modules/Sources}/Fakes/Hardware.generated.swift (100%) rename {Fakes => Modules/Sources}/Fakes/Networking.generated.swift (100%) rename {Fakes => Modules/Sources}/Fakes/NetworkingCore.generated.swift (100%) rename {Fakes/Fakes/Products => Modules/Sources/Fakes}/ProductFactory.swift (100%) rename {Fakes => Modules/Sources}/Fakes/WooFoundation.generated.swift (100%) rename {Fakes => Modules/Sources}/Fakes/WooFoundationCore.generated.swift (100%) rename {Fakes => Modules/Sources}/Fakes/Yosemite.generated.swift (100%) delete mode 100644 Modules/Sources/XcodeSupport/XcodeTarget_Fakes/Empty.swift diff --git a/Fakes/Fakes.xcodeproj/project.pbxproj b/Fakes/Fakes.xcodeproj/project.pbxproj deleted file mode 100644 index 263b525d5bd..00000000000 --- a/Fakes/Fakes.xcodeproj/project.pbxproj +++ /dev/null @@ -1,422 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 02B5147E2825532A00750B71 /* Hardware.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02B5147D2825532A00750B71 /* Hardware.generated.swift */; }; - 20AD34D12B0CD9AF00F38F44 /* WooFoundation.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20AD34D02B0CD9AF00F38F44 /* WooFoundation.generated.swift */; }; - 26106B3D25FA4F6C0000DF30 /* ProductFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26106B3C25FA4F6C0000DF30 /* ProductFactory.swift */; }; - 26CA6D2625F6C87800B01F48 /* Fakes.h in Headers */ = {isa = PBXBuildFile; fileRef = 26CA6D2425F6C87800B01F48 /* Fakes.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 26CA6D2F25F6C8FC00B01F48 /* Fake.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26CA6D2D25F6C8FB00B01F48 /* Fake.swift */; }; - 26EEDC9026FE1C7B00D5BA0E /* Networking.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26EEDC8E26FE1C7B00D5BA0E /* Networking.generated.swift */; }; - 26EEDC9126FE1C7B00D5BA0E /* Yosemite.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26EEDC8F26FE1C7B00D5BA0E /* Yosemite.generated.swift */; }; - 3F2B4AC22DDC30B200E5E49C /* XcodeTarget_Fakes in Frameworks */ = {isa = PBXBuildFile; productRef = 3F2B4AC12DDC30B200E5E49C /* XcodeTarget_Fakes */; }; - 3F37E1232DEEAC7200D8BF2B /* WooFoundationCore.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F37E1222DEEAC7200D8BF2B /* WooFoundationCore.generated.swift */; }; - 3F38F3742DFA9E0800E0FE41 /* NetworkingCore.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F38F3732DFA9E0800E0FE41 /* NetworkingCore.generated.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 263E37EA2641F93300260D3B /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 02B5147D2825532A00750B71 /* Hardware.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Hardware.generated.swift; sourceTree = ""; }; - 20AD34D02B0CD9AF00F38F44 /* WooFoundation.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WooFoundation.generated.swift; sourceTree = ""; }; - 26106B3C25FA4F6C0000DF30 /* ProductFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductFactory.swift; sourceTree = ""; }; - 26CA6D2125F6C87800B01F48 /* Fakes.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Fakes.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 26CA6D2425F6C87800B01F48 /* Fakes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Fakes.h; sourceTree = ""; }; - 26CA6D2525F6C87800B01F48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 26CA6D2D25F6C8FB00B01F48 /* Fake.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fake.swift; sourceTree = ""; }; - 26EEDC8E26FE1C7B00D5BA0E /* Networking.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Networking.generated.swift; sourceTree = ""; }; - 26EEDC8F26FE1C7B00D5BA0E /* Yosemite.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Yosemite.generated.swift; sourceTree = ""; }; - 3F37E1222DEEAC7200D8BF2B /* WooFoundationCore.generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WooFoundationCore.generated.swift; sourceTree = ""; }; - 3F38F3732DFA9E0800E0FE41 /* NetworkingCore.generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkingCore.generated.swift; sourceTree = ""; }; - 3FA7DA002D547F2600CE5611 /* Fakes.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Fakes.xcconfig; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 26CA6D1E25F6C87800B01F48 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3F2B4AC22DDC30B200E5E49C /* XcodeTarget_Fakes in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 26106B3B25FA4F5F0000DF30 /* Products */ = { - isa = PBXGroup; - children = ( - 26106B3C25FA4F6C0000DF30 /* ProductFactory.swift */, - ); - path = Products; - sourceTree = ""; - }; - 26CA6D1725F6C87800B01F48 = { - isa = PBXGroup; - children = ( - 26CA6D2325F6C87800B01F48 /* Fakes */, - 26CA6D2225F6C87800B01F48 /* Products */, - 26CA6D3225F6C92100B01F48 /* Frameworks */, - ); - sourceTree = ""; - }; - 26CA6D2225F6C87800B01F48 /* Products */ = { - isa = PBXGroup; - children = ( - 26CA6D2125F6C87800B01F48 /* Fakes.framework */, - ); - name = Products; - sourceTree = ""; - }; - 26CA6D2325F6C87800B01F48 /* Fakes */ = { - isa = PBXGroup; - children = ( - 26CA6D2D25F6C8FB00B01F48 /* Fake.swift */, - 02B5147D2825532A00750B71 /* Hardware.generated.swift */, - 26EEDC8E26FE1C7B00D5BA0E /* Networking.generated.swift */, - 3F38F3732DFA9E0800E0FE41 /* NetworkingCore.generated.swift */, - 26EEDC8F26FE1C7B00D5BA0E /* Yosemite.generated.swift */, - 20AD34D02B0CD9AF00F38F44 /* WooFoundation.generated.swift */, - 3F37E1222DEEAC7200D8BF2B /* WooFoundationCore.generated.swift */, - 26106B3B25FA4F5F0000DF30 /* Products */, - 26CA6D2425F6C87800B01F48 /* Fakes.h */, - 26CA6D2525F6C87800B01F48 /* Info.plist */, - 3FA7DA002D547F2600CE5611 /* Fakes.xcconfig */, - ); - path = Fakes; - sourceTree = ""; - }; - 26CA6D3225F6C92100B01F48 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 26CA6D1C25F6C87800B01F48 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 26CA6D2625F6C87800B01F48 /* Fakes.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 26CA6D2025F6C87800B01F48 /* Fakes */ = { - isa = PBXNativeTarget; - buildConfigurationList = 26CA6D2925F6C87800B01F48 /* Build configuration list for PBXNativeTarget "Fakes" */; - buildPhases = ( - 26CA6D1C25F6C87800B01F48 /* Headers */, - 26CA6D1D25F6C87800B01F48 /* Sources */, - 26CA6D1E25F6C87800B01F48 /* Frameworks */, - 26CA6D1F25F6C87800B01F48 /* Resources */, - 263E37EA2641F93300260D3B /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Fakes; - packageProductDependencies = ( - 3F2B4AC12DDC30B200E5E49C /* XcodeTarget_Fakes */, - ); - productName = Fakes; - productReference = 26CA6D2125F6C87800B01F48 /* Fakes.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 26CA6D1825F6C87800B01F48 /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1620; - TargetAttributes = { - 26CA6D2025F6C87800B01F48 = { - CreatedOnToolsVersion = 12.4; - LastSwiftMigration = 1240; - }; - }; - }; - buildConfigurationList = 26CA6D1B25F6C87800B01F48 /* Build configuration list for PBXProject "Fakes" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 26CA6D1725F6C87800B01F48; - productRefGroup = 26CA6D2225F6C87800B01F48 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 26CA6D2025F6C87800B01F48 /* Fakes */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 26CA6D1F25F6C87800B01F48 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 26CA6D1D25F6C87800B01F48 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 26CA6D2F25F6C8FC00B01F48 /* Fake.swift in Sources */, - 02B5147E2825532A00750B71 /* Hardware.generated.swift in Sources */, - 26EEDC9026FE1C7B00D5BA0E /* Networking.generated.swift in Sources */, - 3F37E1232DEEAC7200D8BF2B /* WooFoundationCore.generated.swift in Sources */, - 20AD34D12B0CD9AF00F38F44 /* WooFoundation.generated.swift in Sources */, - 26106B3D25FA4F6C0000DF30 /* ProductFactory.swift in Sources */, - 26EEDC9126FE1C7B00D5BA0E /* Yosemite.generated.swift in Sources */, - 3F38F3742DFA9E0800E0FE41 /* NetworkingCore.generated.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 26CA6D2725F6C87800B01F48 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3FA7DA002D547F2600CE5611 /* Fakes.xcconfig */; - 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - 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; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = 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; - 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"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 26CA6D2825F6C87800B01F48 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3FA7DA002D547F2600CE5611 /* Fakes.xcconfig */; - 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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - 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; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = 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; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 26CA6D2A25F6C87800B01F48 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = PZYM8XX95Q; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_MODULE_VERIFIER = YES; - INFOPLIST_FILE = Fakes/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; - PRODUCT_BUNDLE_IDENTIFIER = com.automattic.Fakes.Fakes; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SUPPORTS_MACCATALYST = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 26CA6D2B25F6C87800B01F48 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = PZYM8XX95Q; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_MODULE_VERIFIER = YES; - INFOPLIST_FILE = Fakes/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14"; - PRODUCT_BUNDLE_IDENTIFIER = com.automattic.Fakes.Fakes; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; - SUPPORTS_MACCATALYST = NO; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 26CA6D1B25F6C87800B01F48 /* Build configuration list for PBXProject "Fakes" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 26CA6D2725F6C87800B01F48 /* Debug */, - 26CA6D2825F6C87800B01F48 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 26CA6D2925F6C87800B01F48 /* Build configuration list for PBXNativeTarget "Fakes" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 26CA6D2A25F6C87800B01F48 /* Debug */, - 26CA6D2B25F6C87800B01F48 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCSwiftPackageProductDependency section */ - 3F2B4AC12DDC30B200E5E49C /* XcodeTarget_Fakes */ = { - isa = XCSwiftPackageProductDependency; - productName = XcodeTarget_Fakes; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = 26CA6D1825F6C87800B01F48 /* Project object */; -} diff --git a/Fakes/Fakes.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Fakes/Fakes.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254..00000000000 --- a/Fakes/Fakes.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Fakes/Fakes.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Fakes/Fakes.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d6..00000000000 --- a/Fakes/Fakes.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/Fakes/Fakes/Fakes.h b/Fakes/Fakes/Fakes.h deleted file mode 100644 index dcef8b9a7f5..00000000000 --- a/Fakes/Fakes/Fakes.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// Fakes.h -// Fakes -// -// Created by Ernesto Carrion on 8/03/21. -// - -#import - -//! Project version number for Fakes. -FOUNDATION_EXPORT double FakesVersionNumber; - -//! Project version string for Fakes. -FOUNDATION_EXPORT const unsigned char FakesVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Fakes/Fakes/Fakes.xcconfig b/Fakes/Fakes/Fakes.xcconfig deleted file mode 100644 index c9040e89c7c..00000000000 --- a/Fakes/Fakes/Fakes.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "../../config/Common.xcconfig" diff --git a/Fakes/Fakes/Info.plist b/Fakes/Fakes/Info.plist deleted file mode 100644 index 9bcb244429e..00000000000 --- a/Fakes/Fakes/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - - diff --git a/Modules/Package.swift b/Modules/Package.swift index 1c8773b081d..f2464667f60 100644 --- a/Modules/Package.swift +++ b/Modules/Package.swift @@ -15,6 +15,10 @@ let package = Package( name: "Codegen", targets: ["Codegen"] ), + .library( + name: "Fakes", + targets: ["Fakes"] + ), .library( name: "Experiments", targets: ["Experiments"] @@ -107,6 +111,15 @@ let package = Package( .product(name: "AutomatticTracks", package: "Automattic-Tracks-iOS"), ] ), + .target( + name: "Fakes", + dependencies: [ + "Codegen", + "Hardware", + "Networking", + "Yosemite" + ] + ), .target( name: "Hardware", dependencies: [ @@ -266,7 +279,6 @@ enum XcodeTargetNames { enum XcodeSupport { static var products: [Product] { [ - XcodeTargetNames.fakes, XcodeTargetNames.hardwareTests, XcodeTargetNames.networkingTests, XcodeTargetNames.notificationExtension, @@ -286,15 +298,6 @@ enum XcodeSupport { static var targets: [Target] { [ - .xcodeTarget( - XcodeTargetNames.fakes, - dependencies: [ - "Codegen", - "Hardware", - "Networking", - "Yosemite" - ] - ), .xcodeTarget( XcodeTargetNames.hardwareTests, dependencies: [ @@ -305,6 +308,7 @@ enum XcodeSupport { XcodeTargetNames.networkingTests, dependencies: [ "Codegen", + "Fakes", "Networking", "TestKit", "WooFoundation", @@ -389,6 +393,7 @@ enum XcodeSupport { XcodeTargetNames.wooCommerceTests, dependencies: [ "Codegen", + "Fakes", "TestKit", "WordPressShared", .product(name: "Aztec", package: "AztecEditor-iOS"), @@ -442,6 +447,7 @@ enum XcodeSupport { XcodeTargetNames.yosemiteTests, dependencies: [ "Codegen", + "Fakes", "TestKit", "WooFoundation", "WordPressShared", diff --git a/Modules/Sources/Codegen/Sourcery/Fakes/Hardware-Fakes.yaml b/Modules/Sources/Codegen/Sourcery/Fakes/Hardware-Fakes.yaml index 71b38cb5460..1b7d9eeba75 100644 --- a/Modules/Sources/Codegen/Sourcery/Fakes/Hardware-Fakes.yaml +++ b/Modules/Sources/Codegen/Sourcery/Fakes/Hardware-Fakes.yaml @@ -3,6 +3,6 @@ sources: - ../../../../../Modules/Sources/Hardware/ templates: - Fakes.swifttemplate -output: ../../../../../Fakes/Fakes/Hardware.generated.swift +output: ../../../../../Modules/Sources/Fakes/Hardware.generated.swift args: moduleName: Hardware diff --git a/Modules/Sources/Codegen/Sourcery/Fakes/Networking-Fakes.yaml b/Modules/Sources/Codegen/Sourcery/Fakes/Networking-Fakes.yaml index d1e7f880d8e..0e25c070e41 100644 --- a/Modules/Sources/Codegen/Sourcery/Fakes/Networking-Fakes.yaml +++ b/Modules/Sources/Codegen/Sourcery/Fakes/Networking-Fakes.yaml @@ -4,7 +4,7 @@ configurations: - ../../../../../Modules/Sources/Networking/ templates: - Fakes.swifttemplate - output: ../../../../../Fakes/Fakes/Networking.generated.swift + output: ../../../../../Modules/Sources/Fakes/Networking.generated.swift args: moduleName: Networking - sources: @@ -12,6 +12,6 @@ configurations: - ../../../../../Modules/Sources/NetworkingCore/ templates: - Fakes.swifttemplate - output: ../../../../../Fakes/Fakes/NetworkingCore.generated.swift + output: ../../../../../Modules/Sources/Fakes/NetworkingCore.generated.swift args: moduleName: NetworkingCore diff --git a/Modules/Sources/Codegen/Sourcery/Fakes/WooFoundation-Fakes.yaml b/Modules/Sources/Codegen/Sourcery/Fakes/WooFoundation-Fakes.yaml index 0e37f9918a4..8d7a9d7f6c8 100644 --- a/Modules/Sources/Codegen/Sourcery/Fakes/WooFoundation-Fakes.yaml +++ b/Modules/Sources/Codegen/Sourcery/Fakes/WooFoundation-Fakes.yaml @@ -4,7 +4,7 @@ configurations: - ../../../../../Modules/Sources/WooFoundation templates: - Fakes.swifttemplate - output: ../../../../../Fakes/Fakes/WooFoundation.generated.swift + output: ../../../../../Modules/Sources/Fakes/WooFoundation.generated.swift args: moduleName: WooFoundation - sources: @@ -12,6 +12,6 @@ configurations: - ../../../../../Modules/Sources/WooFoundationCore templates: - Fakes.swifttemplate - output: ../../../../../Fakes/Fakes/WooFoundationCore.generated.swift + output: ../../../../../Modules/Sources/Fakes/WooFoundationCore.generated.swift args: moduleName: WooFoundationCore diff --git a/Modules/Sources/Codegen/Sourcery/Fakes/Yosemite-Fakes.yaml b/Modules/Sources/Codegen/Sourcery/Fakes/Yosemite-Fakes.yaml index 03728afed55..21bf6d95558 100644 --- a/Modules/Sources/Codegen/Sourcery/Fakes/Yosemite-Fakes.yaml +++ b/Modules/Sources/Codegen/Sourcery/Fakes/Yosemite-Fakes.yaml @@ -3,6 +3,6 @@ sources: - ../../../../../Modules/Sources/Yosemite/ templates: - Fakes.swifttemplate -output: ../../../../../Fakes/Fakes/Yosemite.generated.swift +output: ../../../../../Modules/Sources/Fakes/Yosemite.generated.swift args: moduleName: Yosemite diff --git a/Fakes/Fakes/Fake.swift b/Modules/Sources/Fakes/Fake.swift similarity index 100% rename from Fakes/Fakes/Fake.swift rename to Modules/Sources/Fakes/Fake.swift diff --git a/Fakes/Fakes/Hardware.generated.swift b/Modules/Sources/Fakes/Hardware.generated.swift similarity index 100% rename from Fakes/Fakes/Hardware.generated.swift rename to Modules/Sources/Fakes/Hardware.generated.swift diff --git a/Fakes/Fakes/Networking.generated.swift b/Modules/Sources/Fakes/Networking.generated.swift similarity index 100% rename from Fakes/Fakes/Networking.generated.swift rename to Modules/Sources/Fakes/Networking.generated.swift diff --git a/Fakes/Fakes/NetworkingCore.generated.swift b/Modules/Sources/Fakes/NetworkingCore.generated.swift similarity index 100% rename from Fakes/Fakes/NetworkingCore.generated.swift rename to Modules/Sources/Fakes/NetworkingCore.generated.swift diff --git a/Fakes/Fakes/Products/ProductFactory.swift b/Modules/Sources/Fakes/ProductFactory.swift similarity index 100% rename from Fakes/Fakes/Products/ProductFactory.swift rename to Modules/Sources/Fakes/ProductFactory.swift diff --git a/Fakes/Fakes/WooFoundation.generated.swift b/Modules/Sources/Fakes/WooFoundation.generated.swift similarity index 100% rename from Fakes/Fakes/WooFoundation.generated.swift rename to Modules/Sources/Fakes/WooFoundation.generated.swift diff --git a/Fakes/Fakes/WooFoundationCore.generated.swift b/Modules/Sources/Fakes/WooFoundationCore.generated.swift similarity index 100% rename from Fakes/Fakes/WooFoundationCore.generated.swift rename to Modules/Sources/Fakes/WooFoundationCore.generated.swift diff --git a/Fakes/Fakes/Yosemite.generated.swift b/Modules/Sources/Fakes/Yosemite.generated.swift similarity index 100% rename from Fakes/Fakes/Yosemite.generated.swift rename to Modules/Sources/Fakes/Yosemite.generated.swift diff --git a/Modules/Sources/XcodeSupport/XcodeTarget_Fakes/Empty.swift b/Modules/Sources/XcodeSupport/XcodeTarget_Fakes/Empty.swift deleted file mode 100644 index 4bd0828eb88..00000000000 --- a/Modules/Sources/XcodeSupport/XcodeTarget_Fakes/Empty.swift +++ /dev/null @@ -1,7 +0,0 @@ -// We need this file with a dummy type in the package to avoid the following -// error: -// -// > target 'XcodeTarget_' referenced in product 'XcodeTarget_' is empty -import Foundation - -public struct __Empty {} diff --git a/Networking/Networking.xcodeproj/project.pbxproj b/Networking/Networking.xcodeproj/project.pbxproj index ba65fedadb9..697b6d6bf64 100644 --- a/Networking/Networking.xcodeproj/project.pbxproj +++ b/Networking/Networking.xcodeproj/project.pbxproj @@ -50,7 +50,6 @@ 2670C3FC270F4E06002FE931 /* SiteListMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2670C3FB270F4E06002FE931 /* SiteListMapperTests.swift */; }; 2685C0DA263B551300D9EE97 /* AddOnGroupMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2685C0D9263B551300D9EE97 /* AddOnGroupMapperTests.swift */; }; 2685C102263B6A1000D9EE97 /* AddOnGroupRemoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2685C101263B6A1000D9EE97 /* AddOnGroupRemoteTests.swift */; }; - 26FB056C25F6CB9100A40B26 /* Fakes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26FB056B25F6CB9100A40B26 /* Fakes.framework */; }; 311976E02602BD4B006AC56C /* SitePluginsMapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 311976DF2602BD4B006AC56C /* SitePluginsMapperTests.swift */; }; 31A451BD2786344B00FE81AA /* StripeRemoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31A451BC2786344B00FE81AA /* StripeRemoteTests.swift */; }; 31D27C952602B737002EDB1D /* SitePluginsRemoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31D27C942602B737002EDB1D /* SitePluginsRemoteTests.swift */; }; @@ -288,7 +287,6 @@ 2685C0D9263B551300D9EE97 /* AddOnGroupMapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddOnGroupMapperTests.swift; sourceTree = ""; }; 2685C101263B6A1000D9EE97 /* AddOnGroupRemoteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddOnGroupRemoteTests.swift; sourceTree = ""; }; 26E5A08B25A66FD3000DF8F6 /* ProductAttributeTermRemoteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAttributeTermRemoteTests.swift; sourceTree = ""; }; - 26FB056B25F6CB9100A40B26 /* Fakes.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Fakes.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 311976DF2602BD4B006AC56C /* SitePluginsMapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SitePluginsMapperTests.swift; sourceTree = ""; }; 31A451BC2786344B00FE81AA /* StripeRemoteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StripeRemoteTests.swift; sourceTree = ""; }; 31D27C942602B737002EDB1D /* SitePluginsRemoteTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SitePluginsRemoteTests.swift; sourceTree = ""; }; @@ -478,7 +476,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 26FB056C25F6CB9100A40B26 /* Fakes.framework in Frameworks */, 3F2B4ACE2DDC30F400E5E49C /* XcodeTarget_NetworkingTests in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -498,7 +495,6 @@ 35C45CCE73A311BE252F6BF4 /* Frameworks */ = { isa = PBXGroup; children = ( - 26FB056B25F6CB9100A40B26 /* Fakes.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/WooCommerce.xcworkspace/contents.xcworkspacedata b/WooCommerce.xcworkspace/contents.xcworkspacedata index 789e604f544..cee4987ca87 100644 --- a/WooCommerce.xcworkspace/contents.xcworkspacedata +++ b/WooCommerce.xcworkspace/contents.xcworkspacedata @@ -16,7 +16,4 @@ - - diff --git a/WooCommerce/WooCommerce.xcodeproj/project.pbxproj b/WooCommerce/WooCommerce.xcodeproj/project.pbxproj index 36dcef5e2b8..70365733b56 100644 --- a/WooCommerce/WooCommerce.xcodeproj/project.pbxproj +++ b/WooCommerce/WooCommerce.xcodeproj/project.pbxproj @@ -1192,7 +1192,6 @@ 26F94E26267A559300DB6CCF /* ProductAddOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26F94E25267A559300DB6CCF /* ProductAddOn.swift */; }; 26F94E2E267A96A000DB6CCF /* ProductAddOnViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26F94E2D267A96A000DB6CCF /* ProductAddOnViewModel.swift */; }; 26F94E34267AA42F00DB6CCF /* ProductAddOnViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26F94E33267AA42F00DB6CCF /* ProductAddOnViewModelTests.swift */; }; - 26FB056825F6CB6000A40B26 /* Fakes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26FB056725F6CB6000A40B26 /* Fakes.framework */; }; 26FE09DD24D9F3F600B9BDF5 /* LoadingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FE09DC24D9F3F600B9BDF5 /* LoadingView.swift */; }; 26FE09DF24DB871100B9BDF5 /* SurveyViewControllersFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FE09DE24DB871100B9BDF5 /* SurveyViewControllersFactory.swift */; }; 26FE09E124DB8FA000B9BDF5 /* SurveyCoordinatorControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26FE09E024DB8FA000B9BDF5 /* SurveyCoordinatorControllerTests.swift */; }; @@ -4385,7 +4384,6 @@ 26F94E25267A559300DB6CCF /* ProductAddOn.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAddOn.swift; sourceTree = ""; }; 26F94E2D267A96A000DB6CCF /* ProductAddOnViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAddOnViewModel.swift; sourceTree = ""; }; 26F94E33267AA42F00DB6CCF /* ProductAddOnViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAddOnViewModelTests.swift; sourceTree = ""; }; - 26FB056725F6CB6000A40B26 /* Fakes.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Fakes.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 26FE09DC24D9F3F600B9BDF5 /* LoadingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadingView.swift; sourceTree = ""; }; 26FE09DE24DB871100B9BDF5 /* SurveyViewControllersFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurveyViewControllersFactory.swift; sourceTree = ""; }; 26FE09E024DB8FA000B9BDF5 /* SurveyCoordinatorControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurveyCoordinatorControllerTests.swift; sourceTree = ""; }; @@ -6456,7 +6454,6 @@ buildActionMask = 2147483647; files = ( 3F2B4AEC2DDC319800E5E49C /* XcodeTarget_WooCommerceTests in Frameworks */, - 26FB056825F6CB6000A40B26 /* Fakes.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -10413,7 +10410,6 @@ 80E6FC6E276325F60086CD67 /* Clibsodium.xcframework */, 3FF314EF26FC784A0012E68E /* XCTest.framework */, 315E14F32698DA24000AD5FF /* PassKit.framework */, - 26FB056725F6CB6000A40B26 /* Fakes.framework */, 5744BEB0248FE44C000A6FE2 /* SwiftUI.framework */, 3F1FA84128B60125009E246C /* WidgetKit.framework */, 260837082AA66E4A0004A12B /* UserNotifications.framework */, diff --git a/Yosemite/Yosemite.xcodeproj/project.pbxproj b/Yosemite/Yosemite.xcodeproj/project.pbxproj index 91e1f8256e0..cc4ca6e42d2 100644 --- a/Yosemite/Yosemite.xcodeproj/project.pbxproj +++ b/Yosemite/Yosemite.xcodeproj/project.pbxproj @@ -93,7 +93,6 @@ 265BCA0024301ACD004E53EE /* ProductCategoryStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 265BC9FF24301ACD004E53EE /* ProductCategoryStoreTests.swift */; }; 2685C121263E064200D9EE97 /* AddOnGroupStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2685C120263E064200D9EE97 /* AddOnGroupStoreTests.swift */; }; 26E5A09225A8A453000DF8F6 /* ProductAttributeTermStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26E5A09125A8A453000DF8F6 /* ProductAttributeTermStoreTests.swift */; }; - 26FB056A25F6CB7600A40B26 /* Fakes.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26FB056925F6CB7600A40B26 /* Fakes.framework */; }; 312DB64D268BD22B00AA0EE9 /* AppSettingsStoreTests+CardReaderSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 312DB64C268BD22B00AA0EE9 /* AppSettingsStoreTests+CardReaderSettings.swift */; }; 3F2B4ADA2DDC313E00E5E49C /* XcodeTarget_YosemiteTests in Frameworks */ = {isa = PBXBuildFile; productRef = 3F2B4AD92DDC313E00E5E49C /* XcodeTarget_YosemiteTests */; }; 3F7E6AC82DDAD3C1008309F0 /* PointOfSalePopularPurchasableItemFetchStrategyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F7E6AC72DDAD3C1008309F0 /* PointOfSalePopularPurchasableItemFetchStrategyTests.swift */; }; @@ -286,7 +285,6 @@ 265BC9FF24301ACD004E53EE /* ProductCategoryStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductCategoryStoreTests.swift; sourceTree = ""; }; 2685C120263E064200D9EE97 /* AddOnGroupStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddOnGroupStoreTests.swift; sourceTree = ""; }; 26E5A09125A8A453000DF8F6 /* ProductAttributeTermStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAttributeTermStoreTests.swift; sourceTree = ""; }; - 26FB056925F6CB7600A40B26 /* Fakes.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Fakes.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 312DB64C268BD22B00AA0EE9 /* AppSettingsStoreTests+CardReaderSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AppSettingsStoreTests+CardReaderSettings.swift"; sourceTree = ""; }; 3F7E6AC72DDAD3C1008309F0 /* PointOfSalePopularPurchasableItemFetchStrategyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PointOfSalePopularPurchasableItemFetchStrategyTests.swift; sourceTree = ""; }; 3FAB48822E02D29700511E19 /* POSEligibilityServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = POSEligibilityServiceTests.swift; sourceTree = ""; }; @@ -386,7 +384,6 @@ buildActionMask = 2147483647; files = ( 3F2B4ADA2DDC313E00E5E49C /* XcodeTarget_YosemiteTests in Frameworks */, - 26FB056A25F6CB7600A40B26 /* Fakes.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -695,7 +692,6 @@ B5C4EB7720D17329002AC0AF /* Frameworks */ = { isa = PBXGroup; children = ( - 26FB056925F6CB7600A40B26 /* Fakes.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/docs/fakeable.md b/docs/fakeable.md index d37f90fc53a..8626b86b879 100644 --- a/docs/fakeable.md +++ b/docs/fakeable.md @@ -3,7 +3,7 @@ Instantiating models for tests is not a simple task. Sometimes, the initializer has too many attributes and the test does not rely on the full set of attributes. This inconvenience hurts our ability to efficiently unit test our app, which could discourage members from writing them at all. -To help with this, we have introduced a new framework called `Fakes.framework`. This framework defines `.fake()` functions for all of our networking models. +To help with this, we have introduced a module called Fakes at `Modules/Sources/Fakes`. This module defines `.fake()` functions for all of our networking models. The `.fake()` function instantiates a type with fake values. As of now, we are [defining](https://github.com/woocommerce/woocommerce-ios/blob/trunk/Fakes/Fakes/Fake.swift) fake values as empty values. This, in conjunction with the [copiable pattern](https://github.com/woocommerce/woocommerce-ios/blob/trunk/docs/copiable.md) allow us to write tests like: @@ -23,7 +23,7 @@ func test() { } ``` -**Note: This framework is meant to be used in test targets only!** +**Note: This module is meant to be used in test targets only!** ## Generating Fake Methods @@ -70,10 +70,10 @@ It uses a single template, [`Fakes.swifttemplate`](../CodeGeneration/Sourcery/Fa Please refer to the [Sourcery reference](https://cdn.rawgit.com/krzysztofzablocki/Sourcery/master/docs/index.html) for more info about how to write templates. -## Adding Fakeable to a New Xcode Framework +## Adding `Fakeable` to a new module -1. In Xcode target settings, add Codegen to the Xcode framework in General > Frameworks and Libraries. -2. Add a new file `{{FrameworkName}}-Fakes.yaml` under [`CodeGeneration/Sourcery/Fakes`](../CodeGeneration/Sourcery/Fakes) similar to other yaml files in the same folder. +1. Add `Codegen` to the `dependencies` in the module target definition in `Modules/Package.swift` +2. Add a new file `{{ModuleName}}-Fakes.yaml` under [`CodeGeneration/Sourcery/Fakes`](../CodeGeneration/Sourcery/Fakes) similar to other yaml files in the same folder. 3. In [`Fakes.swifttemplate`](../CodeGeneration/Sourcery/Fakes/Fakes.swifttemplate), add a line to import the new framework. -4. In [`Rakefile`](../Rakefile) which includes the script for `rake generate` command, add the new framework to the list of frameworks for Fakeable generation similar to other frameworks. +4. In [`Rakefile`](../Rakefile) which includes the script for `rake generate` command, add the new framework to the list of frameworks for `Fakeable` generation similar to other frameworks. 5. Now you can try generating fake methods as instructed in an earlier section.