BuildAnalyzer

0.0.2

SwiftUI application to analyze Xcode build system graph (Experimental)
polac24/XCBuildAnalyzer

What's New

0.0.2

2023-09-25T03:16:21Z

icon XCBuildAnalyzer

macOS app to inspect Xcode's build system graph

Description

XCBuildAnalyzer is a standalone macOS app that renders the Xcode build system graph with some (limited) timing data. Analyzing the graph might be useful to understand dependencies between particular steps and why does build system invalidates previous build results.

The tool relies on a build manifest json file that is always generated in the project DerivedData directory.

Demo

Getting Started

To analyze your most recent build system graph, drag&drop a project file to the application area. Depending on a size of a project and nodes in a graph, it may take some time but usually should finish within couple of seconds.

On a left pane you will see graph nodes aggregated by target names (if applicable). The build graph is very often massive so to improve the reliability and performance, analyzing a subgraph is recommended.

Selecting a node will render a view with all input and output nodes in the center view.

Main graph

If a node has some hidden input or outputs that were skipped for brevity, the node's icon ⤡ or ⤢ allow expanding them.

Expanding nodes

Selecting multiple nodes (using ⌘ or ⇧) in a left view draws the possible subgraph that includes all nodes.

Screenshot

Expanding nodes

On a right pane, you can inspect step details including input/output nodes, step tool, ENV variables etc.

Screenshot

Expanding nodes

If a build timing data was found along the build manifest, steps that were triggered in the most recent build have timing data. Look for 🔨 icons to found nodes that were recently executed.

Screenshot

Expanding nodes

Expanding nodes

Cycles

If a cycle has been found in the graph, affected nodes have a warning sign. Selecting them draws the full cycle (with some few side nodes):

Expanding nodes

Screenshot

Expanding nodes

Comparing build graphs between builds

By default, XCBuildAnalyzer finds the most recent graph manifest found in the DerivedData, but if you want to analyze or compare specific build graphs, you can drag&drop raw manifest.json files from DerivedData/ProjectName/Build/Intermediates.noindex/XCBuildData/{build_hash}.xcbuilddata/manifest.json.

Note

Keep in mind for raw manifest mode, timing data is not available

Requirements

  • Building a project at least once with Xcode

Supported formats

  • *.xcodeproj
  • .xcworkspace
  • Package.swift
  • manifest.json

Installing

Running from a binary

  • Open the most recent released version
  • Download&unzip the binary
  • Run XCBuildAnalyzer.app

Building a project locally

  • open BuildAnalyzer.xcodeproj
  • [Optional] pick BuildAnalyzer scheme
  • Run the app with ⌘+R

Authors

Contributors names and contact info:

License

This project is licensed under the Apache License

Copyright (c) 2023 Bartosz Polaczyk.

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.

Acknowledgments

This product includes software developed by the "Marcin Krzyzanowski" (http://krzyzanowskim.com/)

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Fri Jul 19 2024 04:33:56 GMT-0900 (Hawaii-Aleutian Daylight Time)