From 68861afc8a478a1c72688abaeef46d90cd8d55b4 Mon Sep 17 00:00:00 2001 From: Fredrik Karlsson Date: Fri, 7 Jun 2019 18:39:31 +0200 Subject: [PATCH] Add support for SPM --- .circleci/config.yml | 98 +++++++++++++++++ .gitignore | 3 + MapboxStatic.xcodeproj/project.pbxproj | 42 ++++---- Package.resolved | 16 +++ Package.swift | 28 +++++ README.md | 13 ++- .../ClassicSnapshotOptions.swift | 2 + .../MapboxStatic}/Color.swift | 0 .../MapboxStatic}/Info.plist | 0 .../MapboxStatic}/MapboxStatic.h | 0 .../MapboxStatic}/MarkerOptions.swift | 0 .../MapboxStatic}/Overlay.swift | 2 + .../MapboxStatic}/Snapshot.swift | 0 .../MapboxStatic}/SnapshotOptions.swift | 2 + .../ClassicOverlayTests.swift | 0 .../ClassicSnapshotTests.swift | 0 .../MapboxStaticTests}/Info.plist | 0 .../MapboxStaticTests.swift | 0 .../MapboxStaticTests}/SnapshotTests.swift | 0 .../MapboxStaticTests}/fixtures/basic-gl.png | Bin .../fixtures/basic-gl@2x.png | Bin .../MapboxStaticTests}/fixtures/basic.png | Bin .../MapboxStaticTests}/fixtures/basic@2x.png | Bin .../MapboxStaticTests}/fixtures/cafe.png | Bin .../MapboxStaticTests}/fixtures/center-gl.png | Bin .../MapboxStaticTests}/fixtures/center.png | Bin .../MapboxStaticTests}/fixtures/format.jpg | Bin .../MapboxStaticTests}/fixtures/format.jpg70 | Bin .../MapboxStaticTests}/fixtures/format.jpg80 | Bin .../MapboxStaticTests}/fixtures/format.jpg90 | Bin .../MapboxStaticTests}/fixtures/format.png | Bin .../MapboxStaticTests}/fixtures/format.png128 | Bin .../MapboxStaticTests}/fixtures/format.png256 | Bin .../MapboxStaticTests}/fixtures/format.png32 | Bin .../MapboxStaticTests}/fixtures/format.png64 | Bin .../MapboxStaticTests}/fixtures/geojson.png | Bin .../MapboxStaticTests}/fixtures/marker.png | Bin .../fixtures/no-attribution.png | Bin .../MapboxStaticTests}/fixtures/no-logo.png | Bin .../MapboxStaticTests}/fixtures/path.png | Bin .../fixtures/polyline.geojson | 0 .../MapboxStaticTests}/fixtures/rocket.png | Bin .../MapboxStaticTests}/fixtures/rotate.png | Bin .../MapboxStaticTests}/fixtures/tilt.png | Bin .../MapboxStaticTests}/fixtures/zoom-gl.png | Bin .../MapboxStaticTests}/fixtures/zoom.png | Bin circle.yml | 101 ------------------ 47 files changed, 187 insertions(+), 120 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 Package.resolved create mode 100644 Package.swift rename {MapboxStatic => Sources/MapboxStatic}/ClassicSnapshotOptions.swift (99%) rename {MapboxStatic => Sources/MapboxStatic}/Color.swift (100%) rename {MapboxStatic => Sources/MapboxStatic}/Info.plist (100%) rename {MapboxStatic => Sources/MapboxStatic}/MapboxStatic.h (100%) rename {MapboxStatic => Sources/MapboxStatic}/MarkerOptions.swift (100%) rename {MapboxStatic => Sources/MapboxStatic}/Overlay.swift (99%) rename {MapboxStatic => Sources/MapboxStatic}/Snapshot.swift (100%) rename {MapboxStatic => Sources/MapboxStatic}/SnapshotOptions.swift (99%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/ClassicOverlayTests.swift (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/ClassicSnapshotTests.swift (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/Info.plist (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/MapboxStaticTests.swift (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/SnapshotTests.swift (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/basic-gl.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/basic-gl@2x.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/basic.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/basic@2x.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/cafe.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/center-gl.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/center.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.jpg (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.jpg70 (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.jpg80 (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.jpg90 (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.png128 (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.png256 (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.png32 (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/format.png64 (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/geojson.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/marker.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/no-attribution.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/no-logo.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/path.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/polyline.geojson (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/rocket.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/rotate.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/tilt.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/zoom-gl.png (100%) rename {MapboxStaticTests => Tests/MapboxStaticTests}/fixtures/zoom.png (100%) delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ead6f27 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,98 @@ +version: 2.1 + +step-library: + - &restore-cache + restore_cache: + keys: + - carthage-cache-mbstatic-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} + - carthage-cache-mbstatic-v1-{{ .Environment.CIRCLE_JOB }} # used if checksum fails + + - &save-cache + save_cache: + key: carthage-cache-mbstatic-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} + paths: + - Carthage + + - &prepare + run: + name: Prepare + command: | + echo "foo" > ~/.mapbox + +jobs: + SPM-job: + parameters: + xcode: + type: string + macos: + xcode: << parameters.xcode >> + environment: + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - checkout + - run: swift build + + build-job: + parameters: + xcode: + type: string + device: + type: string + default: "iPhone 6 Plus" + iOS: + type: string + default: "12.1" + watchOS: + type: string + default: "5.0" + tvOS: + type: string + default: "12.0" + test: + type: boolean + default: true + macos: + xcode: << parameters.xcode >> + environment: + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - checkout + - *prepare + - *restore-cache + - run: + name: Install prerequisites + command: | + if [ $(xcversion simulators | grep -cF "iOS << parameters.iOS >> Simulator (installed)") -eq 0 ]; then xcversion simulators --install="iOS << parameters.iOS >>" || true; fi + - run: + name: Dependencies + command: | + carthage bootstrap --platform ios --cache-builds --configuration Debug --no-use-binaries + carthage bootstrap --platform tvos --cache-builds --configuration Debug --no-use-binaries + carthage bootstrap --platform macos --cache-builds --configuration Debug --no-use-binaries + carthage bootstrap --platform watchos --cache-builds --configuration Debug --no-use-binaries + - *save-cache + - run: + name: iOS + command: xcodebuild -sdk iphonesimulator -project MapboxStatic.xcodeproj -scheme 'MapboxStatic iOS' -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=<< parameters.device >>' clean build <<# parameters.test >>test<> + - run: + name: tvOS + command: xcodebuild -project MapboxStatic.xcodeproj -scheme 'MapboxStatic tvOS' -destination 'platform=tvOS Simulator,name=Apple TV 4K (at 1080p),OS=<< parameters.tvOS >>' clean build <<# parameters.test >>test <> + - run: + name: macOS + command: xcodebuild -project MapboxStatic.xcodeproj -scheme 'MapboxStatic Mac' clean build<<# parameters.test >> test <> + - run: + name: watchOS + command: xcodebuild -project MapboxStatic.xcodeproj -scheme 'MapboxStatic watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=<< parameters.watchOS >>' clean build + +workflows: + workflow: + jobs: + - build-job: + name: "Xcode_10.2" + xcode: "10.2.0" + iOS: "12.2" + tvOS: "12.2" + watchOS: "5.2" + - SPM-job: + name: "SPM" + xcode: "10.2.1" diff --git a/.gitignore b/.gitignore index 03a9bea..61d70c9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ xcuserdata Carthage/Build Carthage/Checkouts + +/.build +/Packages diff --git a/MapboxStatic.xcodeproj/project.pbxproj b/MapboxStatic.xcodeproj/project.pbxproj index 8979732..6642158 100644 --- a/MapboxStatic.xcodeproj/project.pbxproj +++ b/MapboxStatic.xcodeproj/project.pbxproj @@ -375,7 +375,8 @@ DA20FBA91CE401E800B07762 /* Color.swift */, DA20FB9F1CE3DEBB00B07762 /* Info.plist */, ); - path = MapboxStatic; + name = MapboxStatic; + path = Sources/MapboxStatic; sourceTree = ""; }; DA9CC6891E5C550000A14964 /* Frameworks */ = { @@ -498,7 +499,8 @@ DDAD19841BD9B2F80057AC9F /* Info.plist */, DD0C88151BE1A9CC00606E9F /* Fixtures */, ); - path = MapboxStaticTests; + name = MapboxStaticTests; + path = Tests/MapboxStaticTests; sourceTree = ""; }; /* End PBXGroup section */ @@ -722,11 +724,11 @@ }; DA20FBB81CE4757E00B07762 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0820; + LastSwiftMigration = 1020; }; DA20FBC11CE4757E00B07762 = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0820; + LastSwiftMigration = 1020; }; DA4B4B911CE8F83100296A52 = { CreatedOnToolsVersion = 7.3.1; @@ -1129,7 +1131,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = MapboxStatic/Info.plist; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = "-D DEBUG"; @@ -1155,7 +1157,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = MapboxStatic/Info.plist; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStatic; @@ -1182,7 +1184,7 @@ "$(PROJECT_DIR)/Carthage/Build/Mac", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = MapboxStatic/Info.plist; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = "-D DEBUG"; @@ -1190,6 +1192,7 @@ PRODUCT_NAME = MapboxStatic; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1211,13 +1214,14 @@ "$(PROJECT_DIR)/Carthage/Build/Mac", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = MapboxStatic/Info.plist; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStatic; PRODUCT_NAME = MapboxStatic; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1233,11 +1237,12 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/Mac", ); - INFOPLIST_FILE = MapboxStaticTests/Info.plist; + INFOPLIST_FILE = Tests/MapboxStaticTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStaticTests; PRODUCT_NAME = MapboxStaticTests; SDKROOT = macosx; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1251,11 +1256,12 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/Mac", ); - INFOPLIST_FILE = MapboxStaticTests/Info.plist; + INFOPLIST_FILE = Tests/MapboxStaticTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStaticTests; PRODUCT_NAME = MapboxStaticTests; SDKROOT = macosx; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -1273,7 +1279,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS", ); - INFOPLIST_FILE = "$(SRCROOT)/MapboxStatic/Info.plist"; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = "-D DEBUG"; @@ -1302,7 +1308,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS", ); - INFOPLIST_FILE = "$(SRCROOT)/MapboxStatic/Info.plist"; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStatic; @@ -1324,7 +1330,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS", ); - INFOPLIST_FILE = MapboxStaticTests/Info.plist; + INFOPLIST_FILE = Tests/MapboxStaticTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStaticTests; PRODUCT_NAME = MapboxStaticTests; @@ -1341,7 +1347,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/tvOS", ); - INFOPLIST_FILE = MapboxStaticTests/Info.plist; + INFOPLIST_FILE = Tests/MapboxStaticTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStaticTests; PRODUCT_NAME = MapboxStaticTests; @@ -1365,7 +1371,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", ); - INFOPLIST_FILE = MapboxStatic/Info.plist; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = "-D DEBUG"; @@ -1395,7 +1401,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/watchOS", ); - INFOPLIST_FILE = MapboxStatic/Info.plist; + INFOPLIST_FILE = Sources/MapboxStatic/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxStatic; @@ -1584,7 +1590,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = MapboxStaticTests/Info.plist; + INFOPLIST_FILE = Tests/MapboxStaticTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.StaticTests; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1601,7 +1607,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = MapboxStaticTests/Info.plist; + INFOPLIST_FILE = Tests/MapboxStaticTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.StaticTests; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..f29475a --- /dev/null +++ b/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "Polyline", + "repositoryURL": "https://github.com/raphaelmor/Polyline.git", + "state": { + "branch": null, + "revision": "011fbc1b0f27a3398bd0fb7c5e2cf5c62ae82717", + "version": "4.2.1" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..d863f0f --- /dev/null +++ b/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version:5.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "MapboxStatic", + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "MapboxStatic", + targets: ["MapboxStatic"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + .package(url: "https://github.com/raphaelmor/Polyline.git", from: "4.2.1") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages which this package depends on. + .target( + name: "MapboxStatic", + dependencies: ["Polyline"]), + .testTarget( + name: "MapboxStaticTests", + dependencies: ["MapboxStatic"]), + ] +) diff --git a/README.md b/README.md index c2235e9..f31615a 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,29 @@ MapboxStatic.swift pairs well with [MapboxDirections.swift](https://github.com/m ## Installation + +### Carthage Specify the following dependency in your [Carthage](https://github.com/Carthage/Carthage/) Cartfile: ```sh github "mapbox/MapboxStatic.swift" ~> 0.10 ``` -Or in your [CocoaPods](http://cocoapods.org/) Podfile: +### CocoaPods +In your [CocoaPods](http://cocoapods.org/) Podfile: ```podspec pod 'MapboxStatic.swift', '~> 0.10' ``` +### Swift Package Manager + +To install MapboxStatic using the [Swift Package Manager](https://swift.org/package-manager/), add the following package to the `dependencies` in your Package.swift file: + +```swift +.package(url: "https://github.com/mapbox/MapboxStatic.swift.git", from: "0.10.0"), +``` + Then `import MapboxStatic` or `@import MapboxStatic;`. v0.6.2 is the last release of MapboxStatic.swift written in Swift 2.3. The `swift2.3` branch corresponds to this release, plus any critical bug fixes that have been applied since. All subsequent releases will be based on the `master` branch, which is written in Swift 3. The Swift examples below are written in Swift 3; see the `swift2.3` branch’s readme for Swift 2.3 examples. diff --git a/MapboxStatic/ClassicSnapshotOptions.swift b/Sources/MapboxStatic/ClassicSnapshotOptions.swift similarity index 99% rename from MapboxStatic/ClassicSnapshotOptions.swift rename to Sources/MapboxStatic/ClassicSnapshotOptions.swift index 3485dae..ac530c0 100644 --- a/MapboxStatic/ClassicSnapshotOptions.swift +++ b/Sources/MapboxStatic/ClassicSnapshotOptions.swift @@ -5,6 +5,8 @@ #else import UIKit #endif +import CoreLocation + /** A structure that determines what a snapshot depicts and how it is formatted. A classic snapshot is made by compositing one or more [tile sets](https://www.mapbox.com/help/define-tileset/) with optional overlays using the [Legacy Static Images API](https://docs.mapbox.com/api/legacy/static-classic). diff --git a/MapboxStatic/Color.swift b/Sources/MapboxStatic/Color.swift similarity index 100% rename from MapboxStatic/Color.swift rename to Sources/MapboxStatic/Color.swift diff --git a/MapboxStatic/Info.plist b/Sources/MapboxStatic/Info.plist similarity index 100% rename from MapboxStatic/Info.plist rename to Sources/MapboxStatic/Info.plist diff --git a/MapboxStatic/MapboxStatic.h b/Sources/MapboxStatic/MapboxStatic.h similarity index 100% rename from MapboxStatic/MapboxStatic.h rename to Sources/MapboxStatic/MapboxStatic.h diff --git a/MapboxStatic/MarkerOptions.swift b/Sources/MapboxStatic/MarkerOptions.swift similarity index 100% rename from MapboxStatic/MarkerOptions.swift rename to Sources/MapboxStatic/MarkerOptions.swift diff --git a/MapboxStatic/Overlay.swift b/Sources/MapboxStatic/Overlay.swift similarity index 99% rename from MapboxStatic/Overlay.swift rename to Sources/MapboxStatic/Overlay.swift index 6c13ab2..efa4455 100644 --- a/MapboxStatic/Overlay.swift +++ b/Sources/MapboxStatic/Overlay.swift @@ -4,6 +4,8 @@ import UIKit #endif import Polyline +import CoreLocation + let allowedCharacterSet: CharacterSet = { var characterSet = CharacterSet.urlPathAllowed diff --git a/MapboxStatic/Snapshot.swift b/Sources/MapboxStatic/Snapshot.swift similarity index 100% rename from MapboxStatic/Snapshot.swift rename to Sources/MapboxStatic/Snapshot.swift diff --git a/MapboxStatic/SnapshotOptions.swift b/Sources/MapboxStatic/SnapshotOptions.swift similarity index 99% rename from MapboxStatic/SnapshotOptions.swift rename to Sources/MapboxStatic/SnapshotOptions.swift index 78cd81d..33f5050 100644 --- a/MapboxStatic/SnapshotOptions.swift +++ b/Sources/MapboxStatic/SnapshotOptions.swift @@ -5,6 +5,8 @@ #else import UIKit #endif +import CoreLocation + /** A structure defining the viewpoint from which a snapshot is taken. diff --git a/MapboxStaticTests/ClassicOverlayTests.swift b/Tests/MapboxStaticTests/ClassicOverlayTests.swift similarity index 100% rename from MapboxStaticTests/ClassicOverlayTests.swift rename to Tests/MapboxStaticTests/ClassicOverlayTests.swift diff --git a/MapboxStaticTests/ClassicSnapshotTests.swift b/Tests/MapboxStaticTests/ClassicSnapshotTests.swift similarity index 100% rename from MapboxStaticTests/ClassicSnapshotTests.swift rename to Tests/MapboxStaticTests/ClassicSnapshotTests.swift diff --git a/MapboxStaticTests/Info.plist b/Tests/MapboxStaticTests/Info.plist similarity index 100% rename from MapboxStaticTests/Info.plist rename to Tests/MapboxStaticTests/Info.plist diff --git a/MapboxStaticTests/MapboxStaticTests.swift b/Tests/MapboxStaticTests/MapboxStaticTests.swift similarity index 100% rename from MapboxStaticTests/MapboxStaticTests.swift rename to Tests/MapboxStaticTests/MapboxStaticTests.swift diff --git a/MapboxStaticTests/SnapshotTests.swift b/Tests/MapboxStaticTests/SnapshotTests.swift similarity index 100% rename from MapboxStaticTests/SnapshotTests.swift rename to Tests/MapboxStaticTests/SnapshotTests.swift diff --git a/MapboxStaticTests/fixtures/basic-gl.png b/Tests/MapboxStaticTests/fixtures/basic-gl.png similarity index 100% rename from MapboxStaticTests/fixtures/basic-gl.png rename to Tests/MapboxStaticTests/fixtures/basic-gl.png diff --git a/MapboxStaticTests/fixtures/basic-gl@2x.png b/Tests/MapboxStaticTests/fixtures/basic-gl@2x.png similarity index 100% rename from MapboxStaticTests/fixtures/basic-gl@2x.png rename to Tests/MapboxStaticTests/fixtures/basic-gl@2x.png diff --git a/MapboxStaticTests/fixtures/basic.png b/Tests/MapboxStaticTests/fixtures/basic.png similarity index 100% rename from MapboxStaticTests/fixtures/basic.png rename to Tests/MapboxStaticTests/fixtures/basic.png diff --git a/MapboxStaticTests/fixtures/basic@2x.png b/Tests/MapboxStaticTests/fixtures/basic@2x.png similarity index 100% rename from MapboxStaticTests/fixtures/basic@2x.png rename to Tests/MapboxStaticTests/fixtures/basic@2x.png diff --git a/MapboxStaticTests/fixtures/cafe.png b/Tests/MapboxStaticTests/fixtures/cafe.png similarity index 100% rename from MapboxStaticTests/fixtures/cafe.png rename to Tests/MapboxStaticTests/fixtures/cafe.png diff --git a/MapboxStaticTests/fixtures/center-gl.png b/Tests/MapboxStaticTests/fixtures/center-gl.png similarity index 100% rename from MapboxStaticTests/fixtures/center-gl.png rename to Tests/MapboxStaticTests/fixtures/center-gl.png diff --git a/MapboxStaticTests/fixtures/center.png b/Tests/MapboxStaticTests/fixtures/center.png similarity index 100% rename from MapboxStaticTests/fixtures/center.png rename to Tests/MapboxStaticTests/fixtures/center.png diff --git a/MapboxStaticTests/fixtures/format.jpg b/Tests/MapboxStaticTests/fixtures/format.jpg similarity index 100% rename from MapboxStaticTests/fixtures/format.jpg rename to Tests/MapboxStaticTests/fixtures/format.jpg diff --git a/MapboxStaticTests/fixtures/format.jpg70 b/Tests/MapboxStaticTests/fixtures/format.jpg70 similarity index 100% rename from MapboxStaticTests/fixtures/format.jpg70 rename to Tests/MapboxStaticTests/fixtures/format.jpg70 diff --git a/MapboxStaticTests/fixtures/format.jpg80 b/Tests/MapboxStaticTests/fixtures/format.jpg80 similarity index 100% rename from MapboxStaticTests/fixtures/format.jpg80 rename to Tests/MapboxStaticTests/fixtures/format.jpg80 diff --git a/MapboxStaticTests/fixtures/format.jpg90 b/Tests/MapboxStaticTests/fixtures/format.jpg90 similarity index 100% rename from MapboxStaticTests/fixtures/format.jpg90 rename to Tests/MapboxStaticTests/fixtures/format.jpg90 diff --git a/MapboxStaticTests/fixtures/format.png b/Tests/MapboxStaticTests/fixtures/format.png similarity index 100% rename from MapboxStaticTests/fixtures/format.png rename to Tests/MapboxStaticTests/fixtures/format.png diff --git a/MapboxStaticTests/fixtures/format.png128 b/Tests/MapboxStaticTests/fixtures/format.png128 similarity index 100% rename from MapboxStaticTests/fixtures/format.png128 rename to Tests/MapboxStaticTests/fixtures/format.png128 diff --git a/MapboxStaticTests/fixtures/format.png256 b/Tests/MapboxStaticTests/fixtures/format.png256 similarity index 100% rename from MapboxStaticTests/fixtures/format.png256 rename to Tests/MapboxStaticTests/fixtures/format.png256 diff --git a/MapboxStaticTests/fixtures/format.png32 b/Tests/MapboxStaticTests/fixtures/format.png32 similarity index 100% rename from MapboxStaticTests/fixtures/format.png32 rename to Tests/MapboxStaticTests/fixtures/format.png32 diff --git a/MapboxStaticTests/fixtures/format.png64 b/Tests/MapboxStaticTests/fixtures/format.png64 similarity index 100% rename from MapboxStaticTests/fixtures/format.png64 rename to Tests/MapboxStaticTests/fixtures/format.png64 diff --git a/MapboxStaticTests/fixtures/geojson.png b/Tests/MapboxStaticTests/fixtures/geojson.png similarity index 100% rename from MapboxStaticTests/fixtures/geojson.png rename to Tests/MapboxStaticTests/fixtures/geojson.png diff --git a/MapboxStaticTests/fixtures/marker.png b/Tests/MapboxStaticTests/fixtures/marker.png similarity index 100% rename from MapboxStaticTests/fixtures/marker.png rename to Tests/MapboxStaticTests/fixtures/marker.png diff --git a/MapboxStaticTests/fixtures/no-attribution.png b/Tests/MapboxStaticTests/fixtures/no-attribution.png similarity index 100% rename from MapboxStaticTests/fixtures/no-attribution.png rename to Tests/MapboxStaticTests/fixtures/no-attribution.png diff --git a/MapboxStaticTests/fixtures/no-logo.png b/Tests/MapboxStaticTests/fixtures/no-logo.png similarity index 100% rename from MapboxStaticTests/fixtures/no-logo.png rename to Tests/MapboxStaticTests/fixtures/no-logo.png diff --git a/MapboxStaticTests/fixtures/path.png b/Tests/MapboxStaticTests/fixtures/path.png similarity index 100% rename from MapboxStaticTests/fixtures/path.png rename to Tests/MapboxStaticTests/fixtures/path.png diff --git a/MapboxStaticTests/fixtures/polyline.geojson b/Tests/MapboxStaticTests/fixtures/polyline.geojson similarity index 100% rename from MapboxStaticTests/fixtures/polyline.geojson rename to Tests/MapboxStaticTests/fixtures/polyline.geojson diff --git a/MapboxStaticTests/fixtures/rocket.png b/Tests/MapboxStaticTests/fixtures/rocket.png similarity index 100% rename from MapboxStaticTests/fixtures/rocket.png rename to Tests/MapboxStaticTests/fixtures/rocket.png diff --git a/MapboxStaticTests/fixtures/rotate.png b/Tests/MapboxStaticTests/fixtures/rotate.png similarity index 100% rename from MapboxStaticTests/fixtures/rotate.png rename to Tests/MapboxStaticTests/fixtures/rotate.png diff --git a/MapboxStaticTests/fixtures/tilt.png b/Tests/MapboxStaticTests/fixtures/tilt.png similarity index 100% rename from MapboxStaticTests/fixtures/tilt.png rename to Tests/MapboxStaticTests/fixtures/tilt.png diff --git a/MapboxStaticTests/fixtures/zoom-gl.png b/Tests/MapboxStaticTests/fixtures/zoom-gl.png similarity index 100% rename from MapboxStaticTests/fixtures/zoom-gl.png rename to Tests/MapboxStaticTests/fixtures/zoom-gl.png diff --git a/MapboxStaticTests/fixtures/zoom.png b/Tests/MapboxStaticTests/fixtures/zoom.png similarity index 100% rename from MapboxStaticTests/fixtures/zoom.png rename to Tests/MapboxStaticTests/fixtures/zoom.png diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 4deeee6..0000000 --- a/circle.yml +++ /dev/null @@ -1,101 +0,0 @@ -version: 2 - -workflows: - version: 2 - default: - jobs: - - xcode-10 - - xcode-9 - -step-library: - - &restore-cache - restore_cache: - keys: - - carthage-cache-mbstatic-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} - - carthage-cache-mbstatic-v1- # used if checksum fails - - - &save-cache - save_cache: - key: carthage-cache-mbstatic-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} - paths: - - Carthage - - - &prepare - run: - name: Prepare - command: | - git submodule sync - if (brew outdated | grep carthage > /dev/null); then brew upgrade carthage; fi - echo "foo" > ~/.mapbox - - - &install-dependencies - run: - name: Install Dependencies - command: | - carthage bootstrap --platform ios --cache-builds --no-use-binaries - carthage bootstrap --platform tvos --cache-builds --no-use-binaries - carthage bootstrap --platform macos --cache-builds --no-use-binaries - carthage bootstrap --platform watchos --cache-builds --no-use-binaries - - - &build-test-MapboxStatic-ios - run: - name: Build and Test MapboxStatic - command: | - xcodebuild -sdk iphonesimulator -project MapboxStatic.xcodeproj -scheme 'MapboxStatic iOS' -destination "platform=iOS Simulator,name=iPhone 6 Plus,OS=${IOS_VERSION}" clean build test - - - &build-MapboxStatic-watchos - run: - name: Build MapboxStatic for watchOS - command: | - xcodebuild -project MapboxStatic.xcodeproj -scheme 'MapboxStatic watchOS' -destination "platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=${WATCHOS_VERSION}" clean build - - - &build-test-MapboxStatic-tvos - run: - name: Build and Test MapboxStatic for tvOS - command: | - xcodebuild -project MapboxStatic.xcodeproj -scheme 'MapboxStatic tvOS' -destination "platform=tvOS Simulator,name=Apple TV 4K (at 1080p),OS=${TVOS_VERSION}" clean build test - - - &build-test-MapboxStatic-macos - run: - name: Build and Test MapboxStatic for macOS - command: | - xcodebuild -project MapboxStatic.xcodeproj -scheme 'MapboxStatic Mac' clean build test | xcpretty - -jobs: - xcode-10: - macos: - xcode: "10.0.0" - environment: - IOS_VERSION: "12.0" - WATCHOS_VERSION: "5.0" - TVOS_VERSION: "12.0" - HOMEBREW_NO_AUTO_UPDATE: 1 - steps: - - checkout - - *prepare - - *restore-cache - - *install-dependencies - - *build-test-MapboxStatic-ios - - *build-MapboxStatic-watchos - - *build-test-MapboxStatic-tvos - - *build-test-MapboxStatic-macos - - *save-cache - - xcode-9: - macos: - xcode: "9.4.1" - environment: - IOS_VERSION: "11.4" - WATCHOS_VERSION: "4.2" - TVOS_VERSION: "11.4" - HOMEBREW_NO_AUTO_UPDATE: 1 - steps: - - checkout - - *prepare - - *restore-cache - - *install-dependencies - - *build-test-MapboxStatic-ios - - *build-MapboxStatic-watchos - - *build-test-MapboxStatic-tvos - - *build-test-MapboxStatic-macos - - *save-cache