Skip to content

Commit

Permalink
Add simulator to user agent string in case if it's present. (#116)
Browse files Browse the repository at this point in the history
* Update dependencies. Start using xcframework versions of dependencies. Add simulator to user agent string in case if it's present. Fix build related warnings. Add update Carthage build step.
  • Loading branch information
MaximAlien authored Jun 23, 2022
1 parent 083e3da commit 11a941f
Show file tree
Hide file tree
Showing 13 changed files with 206 additions and 281 deletions.
16 changes: 12 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ step-library:
command: |
echo "foo" > ~/.mapbox
- &update-carthage-version
run:
name: Update Carthage version
command: |
curl -OL "https://github.com/Carthage/Carthage/releases/download/0.38.0/Carthage.pkg"
sudo installer -pkg Carthage.pkg -target /
jobs:
SPM-job:
parameters:
Expand Down Expand Up @@ -60,17 +67,18 @@ jobs:
- checkout
- *prepare
- *restore-cache
- *update-carthage-version
- 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: |
./scripts/wcarthage.sh bootstrap --platform ios --cache-builds --configuration Debug --no-use-binaries
./scripts/wcarthage.sh bootstrap --platform tvos --cache-builds --configuration Debug --no-use-binaries
./scripts/wcarthage.sh bootstrap --platform macos --cache-builds --configuration Debug --no-use-binaries
./scripts/wcarthage.sh bootstrap --platform watchos --cache-builds --configuration Debug --no-use-binaries
carthage bootstrap --platform ios --cache-builds --configuration Debug --no-use-binaries --use-xcframeworks
carthage bootstrap --platform tvos --cache-builds --configuration Debug --no-use-binaries --use-xcframeworks
carthage bootstrap --platform macos --cache-builds --configuration Debug --no-use-binaries --use-xcframeworks
carthage bootstrap --platform watchos --cache-builds --configuration Debug --no-use-binaries --use-xcframeworks
- *save-cache
- run:
name: iOS
Expand Down
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "AliSoftware/OHHTTPStubs" "9.0.0"
github "raphaelmor/Polyline" "v5.0.2"
github "AliSoftware/OHHTTPStubs" "9.1.0"
github "raphaelmor/Polyline" "v5.0.3"
2 changes: 1 addition & 1 deletion Example/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (void)viewDidAppear:(BOOL)animated {
options.overlays = @[path];
MBSnapshot *snapshot = [[MBSnapshot alloc] initWithOptions:options accessToken:AccessToken];
__weak typeof(self) weakSelf = self;
[snapshot imageWithCompletionHandler:^(UIImage * _Nullable image, NSError * _Nullable error) {
(void)[snapshot imageWithCompletionHandler:^(UIImage * _Nullable image, NSError * _Nullable error) {
typeof(weakSelf) strongSelf = weakSelf;
strongSelf.imageView.image = image;
}];
Expand Down
275 changes: 112 additions & 163 deletions MapboxStatic.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1340"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAF15A4A1CE90A6C0040E86C"
BuildableName = "MapboxStatic (Objective-C).app"
BlueprintName = "Example (Objective-C)"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DAF15A4A1CE90A6C0040E86C"
BuildableName = "MapboxStatic (Objective-C).app"
BlueprintName = "Example (Objective-C)"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -72,8 +70,6 @@
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1340"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DDAD19581BD9B1780057AC9F"
BuildableName = "MapboxStatic (Swift).app"
BlueprintName = "Example (Swift)"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DDAD19581BD9B1780057AC9F"
BuildableName = "MapboxStatic (Swift).app"
BlueprintName = "Example (Swift)"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -72,8 +70,6 @@
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1340"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DA20FBB81CE4757E00B07762"
BuildableName = "MapboxStatic.framework"
BlueprintName = "MapboxStaticMac"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DA20FBB81CE4757E00B07762"
BuildableName = "MapboxStatic.framework"
BlueprintName = "MapboxStaticMac"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1340"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DA20FB9A1CE3DEBB00B07762"
BuildableName = "MapboxStatic.framework"
BlueprintName = "MapboxStatic"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DA20FB9A1CE3DEBB00B07762"
BuildableName = "MapboxStatic.framework"
BlueprintName = "MapboxStatic"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1340"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DA4B4B911CE8F83100296A52"
BuildableName = "MapboxStatic.framework"
BlueprintName = "MapboxStaticTV"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -40,17 +49,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DA4B4B911CE8F83100296A52"
BuildableName = "MapboxStatic.framework"
BlueprintName = "MapboxStaticTV"
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -71,8 +69,6 @@
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1340"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,12 +26,10 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -52,8 +50,6 @@
ReferencedContainer = "container:MapboxStatic.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"repositoryURL": "https://github.com/AliSoftware/OHHTTPStubs.git",
"state": {
"branch": null,
"revision": "e92b5a5746ef16add2a1424f1fc19529d9a75cde",
"version": "9.0.0"
"revision": "12f19662426d0434d6c330c6974d53e2eb10ecd9",
"version": "9.1.0"
}
},
{
"package": "Polyline",
"repositoryURL": "https://github.com/raphaelmor/Polyline.git",
"state": {
"branch": null,
"revision": "36f7b1222aaf8fa741d0d179c12e186998d97f42",
"version": "5.0.2"
"revision": "554a15b15ff33cf6757f4cb693c5c285fe58694e",
"version": "5.0.3"
}
}
]
Expand Down
13 changes: 12 additions & 1 deletion Sources/MapboxStatic/Snapshot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,18 @@ let userAgent: String = {
#else
chip = "unknown"
#endif
components.append("(\(chip))")

var simulator: String? = nil
#if targetEnvironment(simulator)
simulator = "Simulator"
#endif

let otherComponents = [
chip,
simulator
].compactMap({ $0 })

components.append("(\(otherComponents.joined(separator: "; ")))")

return components.joined(separator: " ")
}()
Expand Down
Loading

0 comments on commit 11a941f

Please sign in to comment.