hmap/README.md

62 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2017-08-21 03:41:06 +08:00
# What is this?
`hmap` is a command line tool to work with Clang header maps produced by Xcode.
It is written in Swift.
2022-02-14 01:11:20 +08:00
NOTE: I've also created [chmap](https://github.com/milend/chmap), a cross-platform tool which provides similar functionality as `hmap`.
2017-08-21 03:41:06 +08:00
# How to Get
- [Homebrew](https://brew.sh): `brew install milend/taps/hmap`
2017-08-21 03:41:06 +08:00
- Grab a [release](https://github.com/milend/hmap/releases) from GitHub.
- Build from source. See instructions below.
# How to Use
To print the contents of a header map:
hmap print ~/path/to/header_map.hmap
To convert the contents of a binary header map to JSON:
hmap convert ~/header_map.hmap ~/header_map.json
`hmap` deduces file formats by looking at the file extensions of the paths.
You can also use the `convert` command to create a binary header map from JSON:
hmap convert ~/header_map.json ~/header_map.hmap
You can discover all the commands and options by using `hmap --help`.
2019-07-27 21:45:43 +08:00
## Requirements
- hmap requires Swift 5.
- Starting from Xcode 10.2, Swift 5 command line tools require the Swift 5 runtime libraries which are included in macOS Majave 10.4.4. If you're running an earlier version of macOS, you need to install the [Swift 5 Runtime Support for Command Line Tools](https://support.apple.com/kb/DL1998).
2019-07-27 21:45:43 +08:00
2017-08-21 03:41:06 +08:00
# Building from Source
## Xcode
2017-08-22 04:39:52 +08:00
Before building with Xcode, you must download all dependencies by running:
swift package update
2017-08-21 03:41:06 +08:00
2017-08-22 04:39:52 +08:00
Then generate an Xcode project by running:
swift package generate-xcodeproj
2017-08-21 03:41:06 +08:00
## Swift Package Manager
If you would like to build from the command line, run:
swift build
To produce a release build suitable for distribution, run:
2019-07-27 21:45:43 +08:00
swift build -c release
2017-08-27 00:44:07 +08:00
To verify that all tests pass, run:
2019-07-27 21:45:43 +08:00
swift test