diff --git a/Cartfile b/Cartfile deleted file mode 100644 index cbec16d..0000000 --- a/Cartfile +++ /dev/null @@ -1 +0,0 @@ -binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" ~> 3.0 diff --git a/Package.swift b/Package.swift index 88fc83b..52d62ac 100644 --- a/Package.swift +++ b/Package.swift @@ -4,23 +4,29 @@ import PackageDescription import Foundation -let version = "24.9.0-daily-2024-11-08-04-26" -let checksum = "c345215659b6bb98ba89cafdcfd8428e5528ec0c6be7464b57ba3cd9244d465b" +let commonVersion = "24.9.0-daily-2024-11-08-04-26" +let commonChecksum = "c345215659b6bb98ba89cafdcfd8428e5528ec0c6be7464b57ba3cd9244d465b" + +let turfVersion = "4.0.0-beta.1" let package = Package( name: "MapboxCommon", platforms: [.iOS(.v12), .macOS(.v10_15), .custom("visionos", versionString: "1.0")], products: [ - .library( - name: "MapboxCommon", - targets: ["MapboxCommon"] - ) + .library(name: "MapboxCommon", targets: ["MapboxCommonWrapper"]), + ], + dependencies: [ + .package(url: "https://github.com/mapbox/turf-swift.git", exact: turfVersion) ], targets: [ + .target(name: "MapboxCommonWrapper", dependencies: [ + .product(name: "Turf", package: "turf-swift"), + .target(name: "MapboxCommon") + ]), .binaryTarget( name: "MapboxCommon", - url: "https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/\(version)/MapboxCommon.zip", - checksum: checksum + url: "https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/\(commonVersion)/MapboxCommon.zip", + checksum: commonChecksum ), .testTarget( name: "MapboxCommonTests", diff --git a/README.md b/README.md index 591d6c6..f182fdd 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To learn more about these SDKs please visit their repos on GitHub and the docume Before you can download the Mapbox Common SDK, you need to create a token with `DOWNLOAD:READ` scope. Go to https://account.mapbox.com and click "Create token" -##### SPM, CocoaPods and Carthage +##### SPM, CocoaPods Insert or append the following to `~/.netrc` ```bash @@ -46,16 +46,3 @@ machine api.mapbox.com ```ruby pod 'MapboxCommon', '24.8.0' ``` - -##### Carthage 📱 - -Add the following code to your Cartfile. - -```bash -binary "https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json" == 24.8.0 -``` - -Then run the following command in the Terminal. -```bash -carthage update --platform ios --use-netrc -``` diff --git a/Sources/MapboxCommonWrapper/Shim.swift b/Sources/MapboxCommonWrapper/Shim.swift new file mode 100644 index 0000000..e69de29 diff --git a/Tests/Integration/Carthage/Sources/AppDelegate.swift b/Tests/Integration/Carthage/Sources/AppDelegate.swift deleted file mode 100644 index 1ffff48..0000000 --- a/Tests/Integration/Carthage/Sources/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import MapboxCommon - - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - assert(ValueConverter.toJson(forValue: 0) == "0") - return true - } -} diff --git a/Tests/Integration/Carthage/Sources/Info.plist b/Tests/Integration/Carthage/Sources/Info.plist deleted file mode 100644 index f904946..0000000 --- a/Tests/Integration/Carthage/Sources/Info.plist +++ /dev/null @@ -1,57 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - $(PRODUCT_NAME) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 0.0.2 - CFBundleSignature - MBGL - CFBundleVersion - 7877 - LSRequiresIPhoneOS - - MGLMapboxAccessToken - $(MAPBOX_ACCESS_TOKEN) - NSHumanReadableCopyright - © 2014–2020 Mapbox - NSLocationAlwaysAndWhenInUseUsageDescription - The map will display your location. If you choose Always, the map may also use your location when it isn’t visible in order to improve OpenStreetMap and Mapbox products. - NSLocationAlwaysUsageDescription - The map will display your location. The map may also use your location when it isn’t visible in order to improve OpenStreetMap and Mapbox products. - NSLocationWhenInUseUsageDescription - The map will display your location. - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/Tests/Integration/Carthage/project.yml b/Tests/Integration/Carthage/project.yml deleted file mode 100644 index 4ddf6aa..0000000 --- a/Tests/Integration/Carthage/project.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: CarthageTest -options: - bundleIdPrefix: com.mapbox.common.carthage -targets: - CarthageTest: - type: application - platform: iOS - deploymentTarget: "13.2" - sources: [Sources] - dependencies: - - framework: Carthage/Build/MapboxCommon.xcframework - - sdk: libc++.tbd - settings: - DEVELOPMENT_TEAM: "GJZR2MEM28" - OTHER_LDFLAGS: "-lc++" diff --git a/Tests/Integration/test_carthage.sh b/Tests/Integration/test_carthage.sh index 44c5418..61d88bf 100755 --- a/Tests/Integration/test_carthage.sh +++ b/Tests/Integration/test_carthage.sh @@ -5,8 +5,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${DIR}/../.." pushd "${ROOT_DIR}/Tests/Integration/Carthage" -xcodegen generate carthage update --platform iOS --use-netrc --use-xcframeworks -xcodebuild -project CarthageTest.xcodeproj -scheme CarthageTest -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' build CODE_SIGNING_ALLOWED=NO popd diff --git a/scripts/release/Sources/set-marketing-version/main.swift b/scripts/release/Sources/set-marketing-version/main.swift index 62eed19..783a8c6 100644 --- a/scripts/release/Sources/set-marketing-version/main.swift +++ b/scripts/release/Sources/set-marketing-version/main.swift @@ -52,13 +52,6 @@ struct MarketingVersion: ParsableCommand { in: podfileURL) } - func runCarthageVersionUpdate() throws { - let cartfileURL = projectPathURL.appendingPathComponent("Tests/Integration/Carthage/Cartfile") - try replaceLineContaining("binary \"https://api.mapbox.com/downloads/v2/carthage/mapbox-common/", - with: "binary \"https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json\" == \(marketingVersion)", - in: cartfileURL) - } - func runSPMVersionUpdate() throws { let spmManifestURL = projectPathURL.appendingPathComponent("Tests/Integration/SPM/project.yml") try replaceLineContaining("branch: release/v", @@ -80,15 +73,10 @@ struct MarketingVersion: ParsableCommand { try replaceLineContaining("pod 'MapboxCommon'", with: "pod 'MapboxCommon', '\(marketingVersion)'", in: readmeURL) - - try replaceLineContaining("binary \"https://api.mapbox.com/downloads/v2/carthage/mapbox-common", - with: "binary \"https://api.mapbox.com/downloads/v2/carthage/mapbox-common/MapboxCommon.json\" == \(marketingVersion)", - in: readmeURL) } mutating func run() throws { try runCocoaPodsVersionUpdate() - try runCarthageVersionUpdate() try runSPMVersionUpdate() if isPreRelease { diff --git a/scripts/release/check-license.sh b/scripts/release/check-license.sh index 6bc1096..08f2d00 100755 --- a/scripts/release/check-license.sh +++ b/scripts/release/check-license.sh @@ -9,7 +9,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${DIR}/../.." pushd "${ROOT_DIR}" -VERSION=`awk '/let version/{print $NF}' "${ROOT_DIR}/Package.swift"` +VERSION=$(awk '/let commonVersion/{print $NF}' "${ROOT_DIR}/Package.swift") VERSION=${VERSION:1:${#VERSION}-2} curl -n "https://api.mapbox.com/downloads/v2/mapbox-common/releases/ios/packages/${VERSION}/MapboxCommon.zip" --output temp-license.zip