GithubHelp home page GithubHelp logo

ainame / xcbeautify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cpisciotta/xcbeautify

0.0 0.0 0.0 868 KB

A little beautifier tool for xcodebuild

License: MIT License

Shell 0.15% Ruby 0.81% Swift 95.21% Makefile 2.60% Starlark 1.22%

xcbeautify's Introduction

xcbeautify

Build Status Latest Release License

xcbeautify is a little beautifier tool for xcodebuild.

Similar to xcpretty, but faster.

Features

  • 2x faster than xcpretty.
  • Human-friendly and colored output.
  • Supports the new build system's output.
  • Supports Xcode's parallel testing output.
  • Supports formatting Swift Package Manager output.
  • Supports formatting Bazel output.
  • Supports macOS & Linux.
  • Written in Swift: xcbeautify compiles to a static binary which you can bring anywhere. This also means less Ruby-dependant in your development environment and CI.

Note: xcbeautify does not support generating JUnit or HTML test reports. In fact, you shouldn't rely on xcodebuild's output to generate test reports. We suggest using trainer or XCTestHTMLReport to generate test reports from xcodebuild's generated TestSummaries.plist files.

Fun fact

xcbeautify uses itself to format its CI build logs.

Installation

If you use macOS 10.14.3 or earlier, install Swift 5 Runtime Support for Command Line Tools first:

brew cask install thii/swift-runtime/swift-runtime

Homebrew

brew install xcbeautify
mint install tuist/xcbeautify

CocoaPods

pod 'xcbeautify'

The xcbeautify binary will be installed at Pods/xcbeautify/xcbeautify

Swift Package Manager

Create a directory in the same location as the xcodeproj file, for example BuildTools.
In that directory, create a Package.swift file with the following contents.
In addition, add an empty file named Empty.swift to the same location.

// swift-tools-version: 5.6
import PackageDescription

let package = Package(
    name: "BuildTools",
    platforms: [.macOS(.v10_11)],
    dependencies: [
      .package(url: "https://github.com/tuist/xcbeautify", from: "0.13.0"),
    ],
    targets: [
      .target(name: "BuildTools", path: "")
    ]
)

Enter this command to execute.

swift run -c release --package-path ./BuildTools xcbeautify

Build from source

git clone https://github.com/tuist/xcbeautify.git
cd xcbeautify
make install

Usage

xcodebuild [flags] | xcbeautify

If you want xcbeautify to exit with the same status code as xcodebuild (e.g. on a CI):

set -o pipefail && xcodebuild [flags] | xcbeautify

For parallel and concurrent destination testing, it helps to use unbuffered I/O for stdout and to redirect stderr to stdout.

NSUnbufferedIO=YES xcodebuild [flags] 2>&1 | xcbeautify
swift test [flags] 2>&1 | xcbeautify

Parse Bazel's building and testing output:

set -o pipefail && bazel build //path/to/package:target 2>&1 | xcbeautify
set -o pipefail && bazel test //path/to/package:target 2>&1 | xcbeautify

Future work

  • Write more tests

Development

Generate Xcode project:

make xcode

Build with Bazel:

bazel build //Sources/xcbeautify

Release a new version, say x.y.z:

make release version=x.y.z

Contributing

Please send a PR!

License

MIT

xcbeautify's People

Contributors

thii avatar greensky01 avatar cyberbeni avatar pepicrft avatar chriszielinski avatar acecilia avatar kinwahlai avatar yageek avatar dependabot[bot] avatar brennantaylor avatar danieleformichelli avatar swiftyfinch avatar adellibovi avatar ealeksandrov avatar guillaumealgis avatar jakub-gonet avatar joshdholtz avatar kitwtnb avatar onmyway133 avatar mpaddle avatar omarzl avatar paultaykalo avatar pieterclaerhout avatar remyjette avatar yonaskolb avatar fortmarek avatar uhooi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.