diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 109fa06..9273d12 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -11,28 +11,14 @@ jobs: runs-on: macOS-latest steps: - - uses: actions/checkout@v1 - - name: install xpretty - run: gem install xcpretty - - name: install pods - run: | - cd Example - pod install - cd .. + - uses: actions/checkout@v4 - name: environment info run: | + swift --version xcodebuild -version - xcodebuild -showsdks - # xcrun instruments -s devices - - name: Test + - name: Resolve package dependencies run: | - SIMULATOR_ID=$(xcrun simctl list devices available | awk -F '[()]' '/iPhone/ { print $2; exit }') - if [ -z "$SIMULATOR_ID" ]; then - echo "No available iPhone simulator found" - xcrun simctl list devices available - exit 1 - fi - - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/MapCache.xcworkspace -scheme MapCache-Example -destination "id=$SIMULATOR_ID" ONLY_ACTIVE_ARCH=NO | xcpretty - # TODO do not allow warnings - pod lib lint --allow-warnings + swift package resolve + - name: Test package + run: | + swift test --parallel diff --git a/Example/MapCache.xcodeproj/project.pbxproj b/Example/MapCache.xcodeproj/project.pbxproj index 9127c87..eb6abcd 100644 --- a/Example/MapCache.xcodeproj/project.pbxproj +++ b/Example/MapCache.xcodeproj/project.pbxproj @@ -3,11 +3,10 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 17B523944AC3587E1B710578 /* Pods_MapCache_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 348184A25D2B058F7588EFE5 /* Pods_MapCache_Example.framework */; }; 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; @@ -24,7 +23,12 @@ 897DE7EE22976D7E0054A9A1 /* MapCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897DE7ED22976D7E0054A9A1 /* MapCacheTests.swift */; }; 8992A46022AF2E7400C186CA /* TileCoordsSpecs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8992A45F22AF2E7400C186CA /* TileCoordsSpecs.swift */; }; 899A5FED23786422008BEC30 /* MapCacheConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 899A5FEC23786422008BEC30 /* MapCacheConfigTests.swift */; }; - C96E40763BA125EDD01D8619 /* Pods_MapCache_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E93B0D3BBC838295972E4B6C /* Pods_MapCache_Tests.framework */; }; + A1B2C3D4E5F60000000000A2 /* MapCache in Frameworks */ = {isa = PBXBuildFile; productRef = A1B2C3D4E5F60000000000A1 /* MapCache */; }; + B1000000000000000000C001 /* Quick in Frameworks */ = {isa = PBXBuildFile; productRef = B1000000000000000000B001 /* Quick */; }; + B1000000000000000000C002 /* Nimble in Frameworks */ = {isa = PBXBuildFile; productRef = B1000000000000000000B002 /* Nimble */; }; + B1000000000000000000C003 /* OHHTTPStubs in Frameworks */ = {isa = PBXBuildFile; productRef = B1000000000000000000B003 /* OHHTTPStubs */; }; + B1000000000000000000C004 /* OHHTTPStubsSwift in Frameworks */ = {isa = PBXBuildFile; productRef = B1000000000000000000B004 /* OHHTTPStubsSwift */; }; + B1000000000000000000C005 /* MapCache in Frameworks */ = {isa = PBXBuildFile; productRef = B1000000000000000000B005 /* MapCache */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -38,11 +42,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 029A071A0FA7D92888CF87C9 /* Pods-MapCache_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MapCache_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example.release.xcconfig"; sourceTree = ""; }; - 1BEC12CD63182437AF00A880 /* Pods-MapCache_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MapCache_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests.debug.xcconfig"; sourceTree = ""; }; - 1C8F9B587DF2612A25CEE462 /* Pods-MapCache_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MapCache_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests.release.xcconfig"; sourceTree = ""; }; - 348184A25D2B058F7588EFE5 /* Pods_MapCache_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MapCache_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 5B36CD7390A71DCA9738479C /* Pods-MapCache_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MapCache_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example.debug.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* MapCache_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MapCache_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -68,8 +67,6 @@ 8992A45F22AF2E7400C186CA /* TileCoordsSpecs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TileCoordsSpecs.swift; sourceTree = ""; }; 899A5FEC23786422008BEC30 /* MapCacheConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapCacheConfigTests.swift; sourceTree = ""; }; 98B68CF07B3AC619DB7870E1 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - E93B0D3BBC838295972E4B6C /* Pods_MapCache_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MapCache_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EEF136F62BE41AE85E8E4DEA /* MapCache.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = MapCache.podspec; path = ../MapCache.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -77,7 +74,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 17B523944AC3587E1B710578 /* Pods_MapCache_Example.framework in Frameworks */, + A1B2C3D4E5F60000000000A2 /* MapCache in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -85,22 +82,17 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C96E40763BA125EDD01D8619 /* Pods_MapCache_Tests.framework in Frameworks */, + B1000000000000000000C005 /* MapCache in Frameworks */, + B1000000000000000000C001 /* Quick in Frameworks */, + B1000000000000000000C002 /* Nimble in Frameworks */, + B1000000000000000000C003 /* OHHTTPStubs in Frameworks */, + B1000000000000000000C004 /* OHHTTPStubsSwift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 22A778E13898723415B67E2D /* Frameworks */ = { - isa = PBXGroup; - children = ( - 348184A25D2B058F7588EFE5 /* Pods_MapCache_Example.framework */, - E93B0D3BBC838295972E4B6C /* Pods_MapCache_Tests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; 607FACC71AFB9204008FA782 = { isa = PBXGroup; children = ( @@ -108,8 +100,6 @@ 607FACD21AFB9204008FA782 /* Example for MapCache */, 607FACE81AFB9204008FA782 /* Tests */, 607FACD11AFB9204008FA782 /* Products */, - B6CB91938DE7FBFF8535B923 /* Pods */, - 22A778E13898723415B67E2D /* Frameworks */, ); sourceTree = ""; }; @@ -173,7 +163,6 @@ 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { isa = PBXGroup; children = ( - EEF136F62BE41AE85E8E4DEA /* MapCache.podspec */, 86806D7962E8E2CA29F7E1EF /* README.md */, 89293F562528CF9C00D8ABA2 /* .jazzy.yaml */, 89293F572528CF9C00D8ABA2 /* .travis.yml */, @@ -192,17 +181,6 @@ path = DiskCache; sourceTree = ""; }; - B6CB91938DE7FBFF8535B923 /* Pods */ = { - isa = PBXGroup; - children = ( - 5B36CD7390A71DCA9738479C /* Pods-MapCache_Example.debug.xcconfig */, - 029A071A0FA7D92888CF87C9 /* Pods-MapCache_Example.release.xcconfig */, - 1BEC12CD63182437AF00A880 /* Pods-MapCache_Tests.debug.xcconfig */, - 1C8F9B587DF2612A25CEE462 /* Pods-MapCache_Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -210,17 +188,18 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MapCache_Example" */; buildPhases = ( - 7455DE55A8CE0D6CA450AA65 /* [CP] Check Pods Manifest.lock */, 607FACCC1AFB9204008FA782 /* Sources */, 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, - BC464C2C3DB7AE8646FF677D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = MapCache_Example; + packageProductDependencies = ( + A1B2C3D4E5F60000000000A1 /* MapCache */, + ); productName = MapCache; productReference = 607FACD01AFB9204008FA782 /* MapCache_Example.app */; productType = "com.apple.product-type.application"; @@ -229,11 +208,9 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "MapCache_Tests" */; buildPhases = ( - 6B83B3883E38A5633315584E /* [CP] Check Pods Manifest.lock */, 607FACE11AFB9204008FA782 /* Sources */, 607FACE21AFB9204008FA782 /* Frameworks */, 607FACE31AFB9204008FA782 /* Resources */, - AC03E736C426B71C2D366C5A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -241,6 +218,13 @@ 607FACE71AFB9204008FA782 /* PBXTargetDependency */, ); name = MapCache_Tests; + packageProductDependencies = ( + B1000000000000000000B005 /* MapCache */, + B1000000000000000000B001 /* Quick */, + B1000000000000000000B002 /* Nimble */, + B1000000000000000000B003 /* OHHTTPStubs */, + B1000000000000000000B004 /* OHHTTPStubsSwift */, + ); productName = Tests; productReference = 607FACE51AFB9204008FA782 /* MapCache_Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -251,8 +235,9 @@ 607FACC81AFB9204008FA782 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 1020; + LastUpgradeCheck = 2620; ORGANIZATIONNAME = CocoaPods; TargetAttributes = { 607FACCF1AFB9204008FA782 = { @@ -275,6 +260,12 @@ Base, ); mainGroup = 607FACC71AFB9204008FA782; + packageReferences = ( + 898B22142FF836BE0085039C /* XCLocalSwiftPackageReference "../../MapCache" */, + B1000000000000000000A001 /* XCRemoteSwiftPackageReference "Quick" */, + B1000000000000000000A002 /* XCRemoteSwiftPackageReference "Nimble" */, + B1000000000000000000A003 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */, + ); productRefGroup = 607FACD11AFB9204008FA782 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -305,85 +296,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 6B83B3883E38A5633315584E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-MapCache_Tests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 7455DE55A8CE0D6CA450AA65 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-MapCache_Example-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - AC03E736C426B71C2D366C5A /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", - "${BUILT_PRODUCTS_DIR}/OHHTTPStubs/OHHTTPStubs.framework", - "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OHHTTPStubs.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MapCache_Tests/Pods-MapCache_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - BC464C2C3DB7AE8646FF677D /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/MapCache/MapCache.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapCache.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-MapCache_Example/Pods-MapCache_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 607FACCC1AFB9204008FA782 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -465,6 +377,7 @@ 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; @@ -475,6 +388,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -490,11 +404,12 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ""; SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; @@ -522,6 +437,7 @@ 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; @@ -532,6 +448,7 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -540,23 +457,27 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + STRING_CATALOG_GENERATE_SYMBOLS = YES; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; 607FACF01AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5B36CD7390A71DCA9738479C /* Pods-MapCache_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MapCache/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -566,12 +487,14 @@ }; 607FACF11AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 029A071A0FA7D92888CF87C9 /* Pods-MapCache_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = MapCache/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -581,7 +504,6 @@ }; 607FACF31AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1BEC12CD63182437AF00A880 /* Pods-MapCache_Tests.debug.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", @@ -592,8 +514,12 @@ "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -603,15 +529,18 @@ }; 607FACF41AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1C8F9B587DF2612A25CEE462 /* Pods-MapCache_Tests.release.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(SDKROOT)/Developer/Library/Frameworks", "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -650,6 +579,73 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 898B22142FF836BE0085039C /* XCLocalSwiftPackageReference "../../MapCache" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../MapCache; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCRemoteSwiftPackageReference section */ + B1000000000000000000A001 /* XCRemoteSwiftPackageReference "Quick" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Quick/Quick.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 3.1.2; + }; + }; + B1000000000000000000A002 /* XCRemoteSwiftPackageReference "Nimble" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Quick/Nimble.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 9.2.0; + }; + }; + B1000000000000000000A003 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/AliSoftware/OHHTTPStubs.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 9.1.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + A1B2C3D4E5F60000000000A1 /* MapCache */ = { + isa = XCSwiftPackageProductDependency; + package = 898B22142FF836BE0085039C /* XCLocalSwiftPackageReference "../../MapCache" */; + productName = MapCache; + }; + B1000000000000000000B001 /* Quick */ = { + isa = XCSwiftPackageProductDependency; + package = B1000000000000000000A001 /* XCRemoteSwiftPackageReference "Quick" */; + productName = Quick; + }; + B1000000000000000000B002 /* Nimble */ = { + isa = XCSwiftPackageProductDependency; + package = B1000000000000000000A002 /* XCRemoteSwiftPackageReference "Nimble" */; + productName = Nimble; + }; + B1000000000000000000B003 /* OHHTTPStubs */ = { + isa = XCSwiftPackageProductDependency; + package = B1000000000000000000A003 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */; + productName = OHHTTPStubs; + }; + B1000000000000000000B004 /* OHHTTPStubsSwift */ = { + isa = XCSwiftPackageProductDependency; + package = B1000000000000000000A003 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */; + productName = OHHTTPStubsSwift; + }; + B1000000000000000000B005 /* MapCache */ = { + isa = XCSwiftPackageProductDependency; + package = 898B22142FF836BE0085039C /* XCLocalSwiftPackageReference "../../MapCache" */; + productName = MapCache; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 607FACC81AFB9204008FA782 /* Project object */; } diff --git a/Example/MapCache.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/MapCache.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..77edc4c --- /dev/null +++ b/Example/MapCache.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,51 @@ +{ + "originHash" : "2247425af2e1482eae33875c43bf93f5b3b4ba5b931489e3c4c59a3010142821", + "pins" : [ + { + "identity" : "cwlcatchexception", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlCatchException.git", + "state" : { + "revision" : "07b2ba21d361c223e25e3c1e924288742923f08c", + "version" : "2.2.1" + } + }, + { + "identity" : "cwlpreconditiontesting", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", + "state" : { + "revision" : "0139c665ebb45e6a9fbdb68aabfd7c39f3fe0071", + "version" : "2.2.2" + } + }, + { + "identity" : "nimble", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Nimble.git", + "state" : { + "revision" : "c93f16c25af5770f0d3e6af27c9634640946b068", + "version" : "9.2.1" + } + }, + { + "identity" : "ohhttpstubs", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AliSoftware/OHHTTPStubs.git", + "state" : { + "revision" : "12f19662426d0434d6c330c6974d53e2eb10ecd9", + "version" : "9.1.0" + } + }, + { + "identity" : "quick", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Quick.git", + "state" : { + "revision" : "8cce6acd38f965f5baa3167b939f86500314022b", + "version" : "3.1.2" + } + } + ], + "version" : 3 +} diff --git a/Example/MapCache.xcodeproj/xcshareddata/xcschemes/MapCache-Example.xcscheme b/Example/MapCache.xcodeproj/xcshareddata/xcschemes/MapCache-Example.xcscheme index 0c17add..9d4c2cf 100644 --- a/Example/MapCache.xcodeproj/xcshareddata/xcschemes/MapCache-Example.xcscheme +++ b/Example/MapCache.xcodeproj/xcshareddata/xcschemes/MapCache-Example.xcscheme @@ -1,6 +1,6 @@ - - diff --git a/Example/MapCache.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Example/MapCache.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..77edc4c --- /dev/null +++ b/Example/MapCache.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,51 @@ +{ + "originHash" : "2247425af2e1482eae33875c43bf93f5b3b4ba5b931489e3c4c59a3010142821", + "pins" : [ + { + "identity" : "cwlcatchexception", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlCatchException.git", + "state" : { + "revision" : "07b2ba21d361c223e25e3c1e924288742923f08c", + "version" : "2.2.1" + } + }, + { + "identity" : "cwlpreconditiontesting", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", + "state" : { + "revision" : "0139c665ebb45e6a9fbdb68aabfd7c39f3fe0071", + "version" : "2.2.2" + } + }, + { + "identity" : "nimble", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Nimble.git", + "state" : { + "revision" : "c93f16c25af5770f0d3e6af27c9634640946b068", + "version" : "9.2.1" + } + }, + { + "identity" : "ohhttpstubs", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AliSoftware/OHHTTPStubs.git", + "state" : { + "revision" : "12f19662426d0434d6c330c6974d53e2eb10ecd9", + "version" : "9.1.0" + } + }, + { + "identity" : "quick", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Quick.git", + "state" : { + "revision" : "8cce6acd38f965f5baa3167b939f86500314022b", + "version" : "3.1.2" + } + } + ], + "version" : 3 +} diff --git a/Example/Podfile b/Example/Podfile deleted file mode 100644 index 606d7c3..0000000 --- a/Example/Podfile +++ /dev/null @@ -1,12 +0,0 @@ -use_frameworks! - -target 'MapCache_Example' do - pod 'MapCache', :path => '../' - - target 'MapCache_Tests' do - inherit! :search_paths - pod 'OHHTTPStubs/Swift','~> 8.0.0' - pod 'Quick', '~> 3.0.0' - pod 'Nimble', '~> 9.2.0' - end -end diff --git a/Example/Podfile.lock b/Example/Podfile.lock deleted file mode 100644 index ab14e0e..0000000 --- a/Example/Podfile.lock +++ /dev/null @@ -1,43 +0,0 @@ -PODS: - - MapCache (0.9.0) - - Nimble (9.2.1) - - OHHTTPStubs/Core (8.0.0) - - OHHTTPStubs/Default (8.0.0): - - OHHTTPStubs/Core - - OHHTTPStubs/JSON - - OHHTTPStubs/NSURLSession - - OHHTTPStubs/OHPathHelpers - - OHHTTPStubs/JSON (8.0.0): - - OHHTTPStubs/Core - - OHHTTPStubs/NSURLSession (8.0.0): - - OHHTTPStubs/Core - - OHHTTPStubs/OHPathHelpers (8.0.0) - - OHHTTPStubs/Swift (8.0.0): - - OHHTTPStubs/Default - - Quick (3.0.0) - -DEPENDENCIES: - - MapCache (from `../`) - - Nimble (~> 9.2.0) - - OHHTTPStubs/Swift (~> 8.0.0) - - Quick (~> 3.0.0) - -SPEC REPOS: - trunk: - - Nimble - - OHHTTPStubs - - Quick - -EXTERNAL SOURCES: - MapCache: - :path: "../" - -SPEC CHECKSUMS: - MapCache: 1dd68aaa2d129af29596cb0a9cfb1b159deba8d8 - Nimble: e7e615c0335ee4bf5b0d786685451e62746117d5 - OHHTTPStubs: 9cbce6364bec557cc3439aa6bb7514670d780881 - Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2 - -PODFILE CHECKSUM: c56222c195164b949de3caaf624bf2962e54ad2a - -COCOAPODS: 1.12.1 diff --git a/Example/Tests/DiskCache/DiskCacheSpecs.swift b/Example/Tests/DiskCache/DiskCacheSpecs.swift index fa82d5b..d796e6c 100644 --- a/Example/Tests/DiskCache/DiskCacheSpecs.swift +++ b/Example/Tests/DiskCache/DiskCacheSpecs.swift @@ -6,6 +6,7 @@ // Copyright © 2019 CocoaPods. All rights reserved. // +import Foundation import Quick import Nimble @testable import MapCache diff --git a/Example/Tests/DiskCache/String+DiskCacheSpecs.swift b/Example/Tests/DiskCache/String+DiskCacheSpecs.swift index cdaa177..bfc71c6 100644 --- a/Example/Tests/DiskCache/String+DiskCacheSpecs.swift +++ b/Example/Tests/DiskCache/String+DiskCacheSpecs.swift @@ -6,6 +6,7 @@ // Copyright © 2019 CocoaPods. All rights reserved. // +import Foundation import Quick import Nimble @testable import MapCache diff --git a/Example/Tests/MapCacheTests.swift b/Example/Tests/MapCacheTests.swift index 8d7a969..d4f7503 100644 --- a/Example/Tests/MapCacheTests.swift +++ b/Example/Tests/MapCacheTests.swift @@ -7,11 +7,13 @@ // // https://github.com/Quick/Quick +import Foundation import Quick import Nimble import MapCache import MapKit import OHHTTPStubs +import OHHTTPStubsSwift class MapCacheTests: QuickSpec { @@ -19,18 +21,18 @@ class MapCacheTests: QuickSpec { beforeSuite { // This stub returns as data the URL of the request stub(condition: isHost("localhost")) { request in - let stubData = request.url?.description.data(using: .utf8) - return OHHTTPStubsResponse(data: stubData!, statusCode:200, headers:nil) + let stubData = request.url?.description.data(using: String.Encoding.utf8) + return HTTPStubsResponse(data: stubData!, statusCode:200, headers:nil) } // This stub returns a 404 error stub(condition: isHost("brokenhost")) { request in - let stubData = request.url?.description.data(using: .utf8) - return OHHTTPStubsResponse(data: stubData!, statusCode:404, headers:nil) + let stubData = request.url?.description.data(using: String.Encoding.utf8) + return HTTPStubsResponse(data: stubData!, statusCode:404, headers:nil) } } afterSuite { - OHHTTPStubs.removeAllStubs() + HTTPStubs.removeAllStubs() } describe("MapCache") { @@ -54,7 +56,7 @@ class MapCacheTests: QuickSpec { cache.fetchTileFromServer( at: path, failure: {error in expect(false) == true}, - success: {data in expect(String(data: data, encoding: .utf8)) == cache.url(forTilePath: path).description} ) + success: {data in expect(String(data: data, encoding: String.Encoding.utf8)) == cache.url(forTilePath: path).description} ) } it("can return error on fetch") { diff --git a/Example/Tests/RegionDownloaderSpecs.swift b/Example/Tests/RegionDownloaderSpecs.swift index 3c852ec..fb9d58a 100644 --- a/Example/Tests/RegionDownloaderSpecs.swift +++ b/Example/Tests/RegionDownloaderSpecs.swift @@ -6,6 +6,7 @@ // Copyright © 2019 CocoaPods. All rights reserved. // +import Foundation import Quick import Nimble import MapKit diff --git a/Example/Tests/Tests.swift b/Example/Tests/Tests.swift index e72a402..204845b 100644 --- a/Example/Tests/Tests.swift +++ b/Example/Tests/Tests.swift @@ -1,5 +1,6 @@ // https://github.com/Quick/Quick +import Foundation import Quick import Nimble import MapCache diff --git a/MapCache.podspec b/MapCache.podspec deleted file mode 100644 index f085459..0000000 --- a/MapCache.podspec +++ /dev/null @@ -1,37 +0,0 @@ -# -# MapCache -# -# MIT License -# Copyright (c) 2019-2023 Juan M. Merlos @merlos -# -# Be sure to run `pod lib lint MapCache.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html -# - -Pod::Spec.new do |s| - s.name = 'MapCache' - s.version = '0.10.0' - s.summary = 'Map caching for iOS. Support offline maps in your app.' - s.description = <<-DESC -Cache for iOS applications for supporting offline tile maps. Downloads and keeps tiles in disk as user browses the map. Also, it can download a complete area at all different zoom levels for a complete offline experience (beta). -DESC - - s.homepage = 'https://github.com/merlos/MapCache' - # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' - s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { 'merlos' => 'merlos@users.noreply.github.com' } - s.source = { :git => 'https://github.com/merlos/MapCache.git', :tag => s.version.to_s } - s.social_media_url = 'https://twitter.com/merlos' - - s.swift_version = '5.0' - s.source_files = 'MapCache/Classes/**/*' - s.ios.deployment_target = '11.0' - s.osx.deployment_target = '10.13' - # s.resource_bundles = { - # 'MapCache' => ['MapCache/Assets/*.png'] - # } - s.frameworks = 'Foundation', 'MapKit' -end diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..beaa244 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,50 @@ +{ + "pins" : [ + { + "identity" : "cwlcatchexception", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlCatchException.git", + "state" : { + "revision" : "07b2ba21d361c223e25e3c1e924288742923f08c", + "version" : "2.2.1" + } + }, + { + "identity" : "cwlpreconditiontesting", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git", + "state" : { + "revision" : "0139c665ebb45e6a9fbdb68aabfd7c39f3fe0071", + "version" : "2.2.2" + } + }, + { + "identity" : "nimble", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Nimble.git", + "state" : { + "revision" : "c93f16c25af5770f0d3e6af27c9634640946b068", + "version" : "9.2.1" + } + }, + { + "identity" : "ohhttpstubs", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AliSoftware/OHHTTPStubs.git", + "state" : { + "revision" : "12f19662426d0434d6c330c6974d53e2eb10ecd9", + "version" : "9.1.0" + } + }, + { + "identity" : "quick", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Quick/Quick.git", + "state" : { + "revision" : "8cce6acd38f965f5baa3167b939f86500314022b", + "version" : "3.1.2" + } + } + ], + "version" : 2 +} diff --git a/Package.swift b/Package.swift index c01de49..fd4475e 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.7 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -6,7 +6,7 @@ import PackageDescription let package = Package( name: "MapCache", platforms: [ - .iOS(.v8), .macOS(.v10_10) + .iOS(.v11), .macOS(.v10_13) ], products: [ // Products define the executables and libraries produced by a package, and make them visible to other packages. @@ -15,8 +15,9 @@ let package = Package( targets: ["MapCache"]), ], dependencies: [ - // Dependencies declare other packages that this package depends on. - // .package(url: /* package url */, from: "1.0.0"), + .package(url: "https://github.com/Quick/Quick.git", from: "3.1.2"), + .package(url: "https://github.com/Quick/Nimble.git", from: "9.2.0"), + .package(url: "https://github.com/AliSoftware/OHHTTPStubs.git", from: "9.1.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. @@ -26,8 +27,14 @@ let package = Package( dependencies: [], path: "MapCache/Classes"), .testTarget( - name: "MapCache-Tests", - dependencies: ["MapCache"], + name: "MapCacheTests", + dependencies: [ + "MapCache", + .product(name: "Quick", package: "Quick"), + .product(name: "Nimble", package: "Nimble"), + .product(name: "OHHTTPStubs", package: "OHHTTPStubs"), + .product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs"), + ], path: "Example/Tests"), ], swiftLanguageVersions: [ .v5 ] diff --git a/README.md b/README.md index 50c0829..63a5747 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,7 @@

[![CI Status](https://travis-ci.com/merlos/MapCache.svg?branch=master)](https://travis-ci.org/github/merlos/MapCache) -[![Version](https://img.shields.io/cocoapods/v/MapCache.svg?style=flat)](https://cocoapods.org/pods/MapCache) -[![License](https://img.shields.io/cocoapods/l/MapCache.svg?style=flat)](https://cocoapods.org/pods/MapCache) -[![Platform](https://img.shields.io/cocoapods/p/MapCache.svg?style=flat)](https://cocoapods.org/pods/MapCache) +[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](LICENSE) [![Documentation](https://www.merlos.org/MapCache/badge.svg)](http://merlos.org/MapCache) ![Swift](https://github.com/merlos/MapCache/workflows/Swift/badge.svg) @@ -23,17 +21,13 @@ Current features: ## Installation -MapCache is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your `Podfile`: +MapCache is available through Swift Package Manager. -```ruby -#Podfile -pod 'MapCache' -``` - -Then in the folder where you have the `Podfile` run the command -```shell -pod install -``` +In Xcode: +1. Open your project. +2. Go to File > Add Package Dependencies... +3. Use the repository URL: `https://github.com/merlos/MapCache.git` +4. Select the MapCache product and add it to your target. ## How to use MapCache? @@ -240,10 +234,15 @@ git clone https://github.com/merlos/MapCache With Xcode Open the file `Example/MapCache.xcworkspace` -To check if the pod is ready to be released run the command in the root folder folder + + +To run tests in the root folder run: ```shell -pod lib lint MapCache.podspec +# +swift test +# cleaning package +swift package clean && swift package resolve && swift test --parallel ``` ### Generate the documentation