Skip to content

Commit

Permalink
Adopt CORESDK-3099/0
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksproger committed Nov 8, 2024
1 parent 79b8b7f commit 958450a
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 123 deletions.
1 change: 0 additions & 1 deletion Cartfile

This file was deleted.

22 changes: 14 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```
Empty file.
13 changes: 0 additions & 13 deletions Tests/Integration/Carthage/Sources/AppDelegate.swift

This file was deleted.

57 changes: 0 additions & 57 deletions Tests/Integration/Carthage/Sources/Info.plist

This file was deleted.

15 changes: 0 additions & 15 deletions Tests/Integration/Carthage/project.yml

This file was deleted.

2 changes: 0 additions & 2 deletions Tests/Integration/test_carthage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 0 additions & 12 deletions scripts/release/Sources/set-marketing-version/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/check-license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 958450a

Please sign in to comment.