Skip to content
XCHammer generates Xcode projects from a Bazel Workspace.
Swift Python Shell Makefile
Branch: master
Clone or download
jerrymarino Reject headermap deps from linker invocations (#215)
This works around the fact that we derive linker invocations from an
ad-hoc synthetic dependency graph.
Latest commit 3b29797 Dec 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows [WIP] Add Github CI (#177) Oct 3, 2019
BazelExtensions Add Bazel Xcode projects (#208) Dec 5, 2019
Docs Add Pinterest Xcode usage documentation (#204) Nov 25, 2019
IntegrationTests Make process_ipa match formatting of other commands (#212) Dec 9, 2019
Sources/XCHammer Reject headermap deps from linker invocations (#215) Dec 20, 2019
XCHammerAssets Add missing quotes to temporary toolchain stubs (#203) Dec 5, 2019
sample [Focus] Support transitive source file inclusion (#209) Dec 5, 2019
third_party [Focus] Support transitive source file inclusion (#209) Dec 5, 2019
tools Integrate XCBuildKit Xcode Progress bar (#207) Dec 6, 2019
.bazelrc Experimental xcode project rule (#190) Oct 31, 2019
.gitattributes Move Samples to Goldmaster Part 1 (#95) Oct 18, 2018
.gitignore Add Bazel Xcode projects (#208) Dec 5, 2019
.travis.yml Bump travis to xcode11 (#188) Oct 14, 2019
BUILD.bazel Integrate XCBuildKit Xcode Progress bar (#207) Dec 6, 2019
Info.plist Remove iOS specific keys from Info.plist (#138) Dec 18, 2018
LICENSE Initial commit Jul 26, 2018
Makefile [Focus] Support transitive source file inclusion (#209) Dec 5, 2019
Package.resolved Mojave, 10.2, Update for Bazel 0.24.1 (#163) May 30, 2019
Package.swift Mojave, 10.2, Update for Bazel 0.24.1 (#163) May 30, 2019
README.md Add feature set to README (#214) Dec 10, 2019
WORKSPACE Integrate XCBuildKit Xcode Progress bar (#207) Dec 6, 2019

README.md

XCHammer

If all you've got is Xcode, your only tool is a 🔨

Build Status

XCHammer generates Xcode projects from a Bazel Workspace.

  • Complete Bazel Xcode IDE integration
    • Bazel build and run via Xcode
    • Xcode test runner integration
    • Full LLDB support without DSYM generation
    • Autocompletion and indexing support
    • Renders Bazel's progress in Xcode's progress bar
    • Optionally import index's via index-import with Run Scripts
    • Customize Bazel invocations for Xcode
  • Focused Xcode projects
  • Xcode build Bazel targets without Bazel
  • Optionally Bazel build Xcode projects
    • Define and compose Xcode projects in Skylark
    • Builds reproducible and remote cacheable projects
  • Automatically updates Xcode projects

Usage

Note: this README is intended to be a minimal, quick start guide. For a comprehensive explanation of XCHammer, see Introducing XCHammer and The XCHammer FAQ

Installation

Build and install to /usr/local/bin/

make install

Pinterest vendors XCHammer.app for reproducibility and simplicity.

Configuration

Generate using a XCHammerConfig.

xchammer generate <configPath>

Configuration Format

XCHammer is configured via a yaml representation of XCHammerConfig.

The configuration describes projects that should be generated.

# Generates a project containing the target ios-app
targets:
    - "//ios-app:ios-app"

projects:
    "MyProject":
        paths:
            - "**"

See XCHammerConfig.swift for detailed documentation of the format.

To learn about how Pinterest uses XCHammer with Bazel locally check out Pinterest Xcode Focused Projects.

Samples

Bazel build Xcode projects

XCHammer additionally supports Bazel building Xcode projects, which enables remote caching and other features. This feature is experimental.

# WORKSPACE
local_repository(
    name = "xchammer_resources",
    path = "/Path/To/xchammer.app/Contents/Resources",
)

# BUILD.Bazel
load("@xchammer_resources//:xcodeproject.bzl", "xcode_project")
xcode_project(
    name = "MyProject",
    targets = [ "//ios-app:ios-app" ],
    paths = [ "**" ],
)

Xcode progress bar integration

XCHammer provides a path to optionally integrate with Xcode's build system and progress bar.

  • Install support for Xcode's progress bar for Xcode 11
xchammer install_xcode_build_system
  • add --build_event_binary_file=/tmp/bep.bep to your .bazelrc
  • make sure Xcode's new build system is enabled

Development

Please find more info about developing XCHammer in The XCHammer FAQ. Pull requests welcome 💖.

You can’t perform that action at this time.