Bug reports and feature requests are more than welcome, but please consider the following tips so we can respond to your feedback more effectively.
Before reporting a bug here, please determine whether the issue lies with the MapboxDirections package or with another Mapbox product:
- For general questions and troubleshooting help, please contact the Mapbox support team.
- Report problems with the map’s contents or routing problems, especially problems specific to a particular route or region, using the Mapbox Feedback tool.
- Report problems in guidance instructions in the OSRM Text Instructions repository (for Directions API profiles powered by OSRM) or the Valhalla repository (for profiles powered by Valhalla).
When reporting a bug in the client-side MapboxDirections package, please indicate:
- The version of MapboxDirections you installed
- The version of CocoaPods, Carthage, or Swift Package Manager that you used to install the package
- The version of Xcode you used to build the package
- The operating system version and device model on which you experienced the issue
- Any relevant settings in
RouteOptions
orMatchOptions
To contribute code changes to this project, use either Carthage or Swift Package Manager to set up a development environment. Carthage and the Xcode project in this repository are important for Apple platforms, particularly for making sure dependent projects can use Carthage. Swift Package Manager is particularly important for Linux.
- Install Xcode 13 and Carthage v0.38 or above.
- Run
carthage bootstrap --platform all --use-xcframeworks
. - Once the Carthage build finishes, open MapboxDirections.xcodeproj in Xcode and build the MapboxDirections Mac scheme.
In Xcode, go to Source Control ‣ Clone, enter https://github.com/mapbox/mapbox-directions-swift.git
, and click Clone.
Alternatively, on the command line:
git clone https://github.com/mapbox/mapbox-directions-swift.git
cd mapbox-directions-swift/
open Package.swift
To add any type, constant, or member to the package’s public interface:
- Name the symbol according to Swift design guidelines and Cocoa naming conventions. This library does not bridge to Objective-C, so the Swift design guidelines matter more than the traditional Cocoa naming conventions. Either way, this package often intentionally differs from the vocabulary and structure of the Mapbox Directions API.
- Provide full documentation comments. We use jazzy to produce the documentation found on the website for this package. Many developers also rely on Xcode’s Quick Help feature, which supports a subset of Markdown.
- (Optional.) Add the type or constant’s name to the relevant category in the
custom_categories
section of the jazzy configuration file. This is required for classes and protocols and also recommended for any other type that is strongly associated with a particular class or protocol. If you leave out this step, the symbol will appear in an “Other” section in the generated HTML documentation’s table of contents.
- Add a file to Tests/MapboxDirectionsTests/
- Add a file reference to the MapboxDirectionsTests group in MapboxDirections.xcodeproj.
- Add a
test*
method to one of the classes in one of the files in Tests/MapboxDirectionsTests/.
- Add a file to Tests/MapboxDirectionsTests/Fixtures/.
- Inside a test case, call
Fixture.stringFromFileNamed(name:)
orFixture.JSONFromFileNamed(name:)
.
Go to Product ‣ Test in Xcode, or run swift test
on the command line.
Pull requests are appreciated. If your PR includes any changes that would impact developers or end users, please mention those changes in the “main” section of CHANGELOG.md, noting the PR number. Examples of noteworthy changes include new features, fixes for user-visible bugs, and renamed or deleted public symbols.
Before we can merge your PR, it must pass automated continuous integration checks on each of the supported platforms, as well as a check to ensure that code coverage has not decreased significantly.
To release a new version of the MapboxDirections package:
- Run
./scripts/update-version.sh v#.#.#
, where #.#.# is a new version number conforming to Semantic Versioning. Commit the changes with a commit message likev#.#.#
and open a pull request to get it reviewed and merged. - Tag the merged changes as
v#.#.#
. Push the tag by runninggit pull && git push origin v#.#.#
. - Create a new release. Add release notes based on the release’s section in the changelog. (Unlike the changelog, release notes accept
#123
syntax for linking to PRs.) Title the releasev#.#.#
. Check “This is a pre-release” if applicable, then click “Publish release”. - Run
pod repo update && pod trunk push MapboxDirections.podspec
(orpod trunk push MapboxDirections-pre.podspec
for a prerelease) to publish the release on CocoaPods trunk. - Go to the mapbox-directions-swift project on CircleCI, select the build corresponding to the tagged commit, and click “Approve Publish Documentation”. This step runs
./scripts/publish-documentation.sh v#.#.#
to generate and publish the documentation and pushes it to thepublisher-production
branch. - Wait about 10 minutes for new documentation to go live. (Mapbox employees can check the #publisher channel in Slack for a notification of when the commit has been published.)
- (Mapbox employees only.) Update various links to the current docset in the [iOS documentation] site.
- (Mapbox employees only.) Update various links to the current docset in the help site.
- For a new major version, upgrade the iOS navigation SDK’s Cartfile, podspecs, and Package.swift to the new version.