An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode's Issue Navigator giving them project-wide visibility.

Overview

XcodeIssueGenerator

An executable that can be called from a Run Script Build Phase that makes comments such as // TODO: or // SERIOUS: appear in Xcode's Issue Navigator giving them project-wide visibility.

  • Works in Swift files.
  • An upside of using this program as compared to #warning pragmas available to Objective-C is we can keep "treat warnings as errors" on in the host project build settings since this executable runs post-build.
  • Comments can be configured as warnings or errors. Error-producing comments stop the build from succeeding.
  • Warning or error behavior for comments can be configured differently per build configuration—you can have a // TODO: be a warning in DEBUG and be an error in RELEASE for instance.

Installation

Install with Homebrew

brew tap doubleencore/tap
brew install xcodeissuegenerator

Xcode 8 and Swift 3 are required to build XcodeIssueGenerator.

Install Manually

Download the latest release or build the project yourself. Copy the XcodeIssueGenerator executable to your /usr/local/bin directory and make it executable: chmod +x /usr/local/bin/XcodeIssueGenerator. Call the XcodeIssueGenerator executable from a Run Script build phase.

Adding a Run Script Build Phase

Select the target on which to run XcodeIssueGenerator, select Build Phases, and select the "+" icon to add a new Run Script phase. Then put in a call to XcodeIssueGenerator as in the example below.

Example Run Script

if which XcodeIssueGenerator >/dev/null; then
    # Mark WARNINGs, SERIOUSs, and TODOs as warnings in DEBUG builds excluding the Vendor and Third Party directories.
    XcodeIssueGenerator -b DEBUG -w "WARNING, SERIOUS, TODO" -x "Vendor/, Third Party/"

    # Mark WARNINGs and SERIOUSs as warnings and TODOs as errors in RELEASE builds excluding the Vendor and Third Party directories.
    XcodeIssueGenerator -b RELEASE -w "WARNING, SERIOUS" -e TODO -x "Vendor/, Third Party/"
else
    echo "warning: XcodeIssueGenerator is not installed."
fi

With the Run Script above, we'll show all comments in Issue Navigator as warnings in DEBUG builds. In RELEASE builds, we'll mark TODOs as errors as a way to block unfinished work from becoming part of a release build.

Options

  • -w warnings tags list (required if no -e)
  • -e error tags list (required if no -w)
  • -b build configuration (required)
  • -x exclude directories (optional)

Tags can be any string. Multiple tags should be separated by commas. Build configurations should match those in the host Xcode project.

License

XcodeIssueGenerator is released under the MIT license. See LICENSE for details.

Comments
  • Could not make exclude directory

    Could not make exclude directory

    I'm getting the message Could not make exclude directory. Directories should be relative to the project file which is the same as being relative to ($SRCROOT). when I run the executable from the top level directory of my project directly and in a Run Script Build Phase.

    My directory structure is as such:

    MyAppFolder/
        Model/      # source dir
        Controller/ # source dir
        View/       # source dir
        Podfile
        Podfile.lock
        Pods
        README.md
        Services
        Support
        Supporting Files
        MyApp
        MyApp.xcodeproj
        MyApp.xcworkspace
    

    The value of $SRCROOT is MyAppFolder.

    Am I breaking some assumptions with the directory structure?

    opened by idrisr 5
  • Alcatraz Package Manager

    Alcatraz Package Manager

    It would be awesome if your plugin was available in Alcatraz Package Manager. It's really easy to do, as you can see HERE:

    Fork the Alcatraz package repository and include your package with name, description, URL, and optional screenshot. Don't forget to submit a pull request. Further instructions are included in the package repository documentation.

    enhancement 
    opened by lfarah 3
  • Can't compile

    Can't compile

    Getting this error when running the XcodeIssueGenerator.xcodeproj:

    /Users/lucasfarah/Downloads/XcodeIssueGenerator-master/XcodeIssueGenerator/main.swift:88: error: // CRITICAL: Dogfooding the issue generator with a CRITICAL. Program ended with exit code: 1

    opened by lfarah 2
  • Homebrew support

    Homebrew support

    Firstly, let me thank you for the great work you are doing!

    I noticed the installation and updates can be little complicated. Have you thought about Homebrew support? I think it would make using the issue generator much easier. And you wouldn't be the only project who would work this way. I am mentioning https://github.com/Flinesoft/BartyCrouch, as an example.

    opened by mkj-is 1
  • Easy script

    Easy script

    I use this script to do show warnings for TODO, WARNING, and FIXME so I don't forget about them.

    KEYWORDS="TODO:|FIXME:|WARNING:|\?\?\?:|\!\!\!:" find "${SRCROOT}" \( -name "*.swift" \) -print0 | \ xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | \ perl -p -e "s/($KEYWORDS)/ warning: \$1/"

    opened by MaxHasADHD 1
  • Error with $SRCROOT containing whitespace characters

    Error with $SRCROOT containing whitespace characters

    I ran XCodeIssueGenerator from the command line with a relative path for $SRCROOT set to ./ and it works as expected. However since my project is in a folder that contains a spaces it fails.

    SRCROOT="./" CONFIGURATION=DEBUG XcodeIssueGenerator -b DEBUG -w "WARNING, SERIOUS" -e "TODO" -x "Vendor/"
    

    This gives me the proper output

    ...swift:151: error: // TODO: foo bar
    ...swift:350: error: // TODO: this should be better
    

    Example

    No matter if relative or absolute, as soon as the path contains spaces it fails.

    SRCROOT="../../My Folder/MyIOSProject" CONFIGURATION=DEBUG XcodeIssueGenerator -b DEBUG -w "WARNING, SERIOUS" -e "TODO" -x "Vendor/"
    

    It also fails with the escaped path instead of using double quotes

    SRCROOT=../../My\ Folder/MyIOSProject CONFIGURATION=DEBUG XcodeIssueGenerator -b DEBUG -w "WARNING, SERIOUS" -e "TODO" -x "Vendor/"
    

    Actual Result

    An error ocurred while finding tags.
    
    opened by christianklotz 1
  • Doesn't find tags with no space after the

    Doesn't find tags with no space after the "//"

    I use //TEMP (with no space) to mark temporary code. (I don't know why there isn't a space. My fingers just type this string automatically, these days.) The regex that looks for tags doesn't find this because it wants exactly one space before the tag.

    Could you start the regex with "//\s* instead of "//, i.e. allow any or no whitespace after the //?

    opened by snej 1
  • Scan other file types

    Scan other file types

    At a minimum, please add .mm (Objective-C++). My project also has C++ source with file types .cc and .hh (and I know a lot of people use .cpp for C++.)

    opened by snej 1
Releases(v0.5.3)
Script to support easily using Xcode Asset Catalog in Swift.

Misen Misen is a script to support using Xcode Asset Catalog in Swift. Features Misen scans sub-directories in the specified Asset Catalog and creates

Kazunobu Tasaka 123 Jun 29, 2022
Automatically build and rebuild Xcode image catalogs for app icons, universal images, and more

Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more.

Dotan J. Nahum 822 Dec 21, 2022
Xcode-compatible build tool.

xcbuild xcbuild is an Xcode-compatible build tool with the goal of providing faster builds, better documentation of the build process and running on m

Meta Archive 2k Dec 11, 2022
ViewMonitor can measure view positions with accuracy.

What's ViewMonitor ViewMonitor can measure view positions with accuracy. This library is to check design sheet from native app. behave like this. UIVi

Daisuke Yamashita 728 Sep 26, 2022
This repository contains rules for Bazel that can be used to generate Xcode projects

rules_xcodeproj This repository contains rules for Bazel that can be used to generate Xcode projects. If you run into any problems with these rules, p

BuildBuddy 233 Dec 28, 2022
Generate a constants file by grabbing identifiers from storyboards in a project.

sbconstants Generate a constants file by grabbing identifiers from storyboards in a project. Installation $ gem install sbconstants Usage For automate

paul.s 310 Sep 9, 2022
automatically delete the current project's DerivedData directories

Feature automatically delete the current project's DerivedData directories Usage It will be automatically deleted DerivedData when you run the clean I

Toshihiro Morimoto 242 Dec 16, 2022
Navigator - A sample custom car navigator with all main opportunities of popular ones

Navigator A sample custom car navigator with all main opportunities of popular o

Neo 1 Apr 4, 2022
🚘 A simple tool for updating Carthage script phase

Do you use Carthage? Are you feel tired of adding special script and the paths to frameworks (point 4, 5 and 6 in Getting Started guide) manually? Me

Artem Novichkov 184 Dec 11, 2021
SwiftUI implementation of xcodes by RobotsAndPencils

XcodeUpdates SwiftUI implementation of xcodes by RobotsAndPencils Screenshots Technical Details Project supports macOS Big Sur (11.+) Project is writt

Ruslan Alikhamov 222 Oct 2, 2022
A blog project where you can write your articles, upload photos, categorize them, and add them to your favorites

A blog project where you can write your articles, upload photos, categorize them, and add them to your favorites. The aim of the project is to learn the use of Core Data.

Cem 7 Mar 21, 2022
AutoKeyboardScrollView is an UIScrollView subclass which makes showing and dismissing keyboard for UITextFields much easier. So called keyboard avoidance.

AutoKeyboardScrollView AutoKeyboardScrollView is a smart UIScrollView which can: Scroll to proper position and make sure the active textField is visib

HongHao Zhang 120 Jul 31, 2022
Todo-list - Simple todo list app written in Swift

About TodoApp TodoApp is sinmple todo list app that I created in my free time, i

null 2 Aug 30, 2022
Todo-app-swift- - A Todo Lists app built using swift

TODO-Lists App Available on the App Store What is this? This is a todo app I mad

Kushal Shingote 3 Feb 20, 2022
A package manager that installs and runs executable Swift packages

Mint ?? A package manager that installs and runs Swift command line tool packages. $ mint run realm/[email protected] This would install and run SwiftL

Yonas Kolb 2k Jan 7, 2023
Simulate GPS location system-wide

locsim A tool to simulate GPS location system-wide. This tool simulates GPS location natively without any runtime injection, and it's how Apple do it.

udevs 47 Dec 29, 2022
TTSLanguage: Text To Speech commandline executable for macOS

TTSLanguage Text To Speech commandline executable for macOS. It can detect sentence language and read it using proper voice. example: $ TTSLanguage "H

Mateusz Szlosek 2 Jan 17, 2022
A macOS menu bar app that enables system-wide navigation functionality for side buttons on third-party mice.

SaneSideButtons macOS mostly ignores the M4/M5 mouse buttons, commonly used for navigation. Third-party apps can bind them to ⌘+[ and ⌘+], but this on

Jan Hülsmann 121 Dec 23, 2022
A script to fetch packages via Github search and diff them against SPI

spi-package-importer importer is a command line utility with three subcommands: fetch package lists from Github via search and save them to JSON files

Swift Package Index 1 Jan 17, 2022
Share-sheet-example - A sample project that reproduces an issue with Share Sheets

Hello, DTS! This project demonstrates the issue I'm having with the Share Sheet.

Marcos Tanaka 0 Feb 11, 2022